Skip to content

Chat Completions

Endpoint

1
POST /v1/chat/completions

OpenAI-compatible. If you're already using the OpenAI SDK, point baseURL at https://api.pokkit.dev/v1 and it works as-is.

Request body

Field Type Required Description
model string yes Model identifier. Determines which provider is used — see Models.
messages array yes Conversation history. Each item has role and content.
stream boolean no If true, responses are sent as SSE chunks (OpenAI event format).
max_tokens integer no Maximum tokens in the response. Defaults vary by provider.
temperature number no Sampling temperature (0–2). Provider defaults apply if omitted.

Message roles

Role Description
system System prompt. Extracted and handled natively for Anthropic requests.
user Human turn.
assistant Prior model response.
tool Tool result (passed through; tool use orchestration is handled upstream).

Response

The response is forwarded directly from the upstream provider. For non-streaming requests this is a JSON object; for streaming it is a series of SSE events. Both follow the OpenAI wire format.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
curl https://api.pokkit.dev/v1/chat/completions \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "messages": [
      { "role": "system", "content": "You are a concise assistant." },
      { "role": "user", "content": "What is the capital of France?" }
    ],
    "max_tokens": 64
  }'
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
curl https://api.pokkit.dev/v1/chat/completions \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen3.5-397B-A17B",
    "messages": [
      { "role": "user", "content": "Write a short Python function that reverses a string." }
    ],
    "temperature": 0.2
  }'
1
2
3
4
5
6
7
8
9
curl https://api.pokkit.dev/v1/chat/completions \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-4-6",
    "messages": [
      { "role": "user", "content": "Summarize the history of the internet in three sentences." }
    ]
  }'