API Reference

Base URL

Every instance exposes its API at:

https://chat.syndicai.dev/<your-instance>/v1

Replace <your-instance> with the name shown in your instance dashboard.

Authentication

All API requests require a Bearer token using your API key:

Authorization: Bearer your-api-key

Generate API keys from your instance dashboard. Each squad member should use their own key for individual usage tracking.

Endpoints

POST /v1/chat/completions

Create a chat completion. This is the primary endpoint for all coding interactions.

Request body:

Field Type Required Description
model string Yes Model identifier (e.g., minimax-m2.5)
messages array Yes Array of message objects with role and content
temperature number No Sampling temperature (0.0–2.0, default: 0.7)
max_tokens number No Maximum tokens to generate
stream boolean No Enable streaming responses (default: false)
top_p number No Nucleus sampling parameter (default: 1.0)
stop string or array No Stop sequences

Example request (curl):

curl -X POST https://chat.syndicai.dev/squad-abc123/v1/chat/completions \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-m2.5",
    "messages": [
      {"role": "system", "content": "You are a senior software engineer."},
      {"role": "user", "content": "Write a TypeScript function that debounces an async function and returns the result of the latest call."}
    ],
    "temperature": 0.3,
    "max_tokens": 2048
  }'

Example response:

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1741900800,
  "model": "minimax-m2.5",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Here's a TypeScript debounce function for async operations:\n\n```typescript\nfunction debounceAsync<T extends (...args: any[]) => Promise<any>>(\n  fn: T,\n  delay: number\n): (...args: Parameters<T>) => Promise<ReturnType<T>> {\n  let timeoutId: ReturnType<typeof setTimeout> | null = null;\n  let latestResolve: ((value: any) => void) | null = null;\n\n  return (...args: Parameters<T>) => {\n    return new Promise((resolve) => {\n      if (timeoutId) clearTimeout(timeoutId);\n      latestResolve = resolve;\n\n      timeoutId = setTimeout(async () => {\n        const result = await fn(...args);\n        if (latestResolve === resolve) {\n          resolve(result);\n        }\n      }, delay);\n    });\n  };\n}\n```"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 42,
    "completion_tokens": 186,
    "total_tokens": 228
  }
}

GET /v1/models

List the model served by your instance.

Example request:

curl https://chat.syndicai.dev/squad-abc123/v1/models \
  -H "Authorization: Bearer your-api-key"

Example response:

{
  "object": "list",
  "data": [
    {
      "id": "minimax-m2.5",
      "object": "model",
      "owned_by": "syndicai"
    }
  ]
}

Streaming

Set "stream": true to receive Server-Sent Events (SSE) as the model generates tokens:

curl -X POST https://chat.syndicai.dev/squad-abc123/v1/chat/completions \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-m2.5",
    "messages": [{"role": "user", "content": "Explain quicksort in one paragraph"}],
    "stream": true
  }'

Each SSE event contains a delta with the incremental content:

data: {"id":"chatcmpl-abc","choices":[{"delta":{"content":"Quick"},"index":0}]}
data: {"id":"chatcmpl-abc","choices":[{"delta":{"content":"sort"},"index":0}]}
...
data: [DONE]

Code Examples

Python

from openai import OpenAI

client = OpenAI(
    base_url="https://chat.syndicai.dev/squad-abc123/v1",
    api_key="your-api-key",
)

# Non-streaming
response = client.chat.completions.create(
    model="minimax-m2.5",
    messages=[
        {"role": "system", "content": "You are a helpful coding assistant."},
        {"role": "user", "content": "Write tests for a React useDebounce hook"},
    ],
    temperature=0.3,
)
print(response.choices[0].message.content)

# Streaming
stream = client.chat.completions.create(
    model="minimax-m2.5",
    messages=[{"role": "user", "content": "Explain the visitor pattern"}],
    stream=True,
)
for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

TypeScript

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://chat.syndicai.dev/squad-abc123/v1",
  apiKey: "your-api-key",
});

const response = await client.chat.completions.create({
  model: "minimax-m2.5",
  messages: [
    { role: "system", content: "You are a senior TypeScript developer." },
    { role: "user", content: "Refactor this function to use generics" },
  ],
  temperature: 0.3,
});

console.log(response.choices[0].message.content);

Rate Limiting

Coding instances have no token-based rate limits. The instance processes requests as fast as the GPU allows. The limit is your tier's weekly GPU budget; once it is reached the instance stops until the budget resets.

Inference instances can cap each API key at a number of requests per minute. A key over its cap gets HTTP 429 with a Retry-After header. See Inference Limits.

During active hours, the vLLM engine handles concurrent requests efficiently via continuous batching. Typical generation speed is tens to a few hundred tokens per second, depending on the model and the GPU configuration.

Error Codes

Errors use the OpenAI envelope: {"error": {"message", "type", "code"}}.

Status Code Description
401 invalid_api_key The API key is missing, invalid, or revoked
402 credit_exhausted The account's credit balance is zero. Top up to restart
413 payload_too_large The request body is over the instance's limit (20 MiB, or 64 MiB with image input)
429 rate_limit_exceeded A key is over its requests-per-minute cap (inference instances). Wait for Retry-After
503 instance_paused The instance is paused. An authenticated inference request starts it
503 server_activating The instance is starting. Retry after the Retry-After seconds
503 server_reprovisioning The host was lost and a new one is being set up