Kryyt / Developers
Chat Completions
POST messages to the Chat Completions endpoint and receive an assistant message.
POST /v1/chat/completionsRequest
{
"model": "deepseek-v4.1-flash",
"messages": [
{
"role": "user",
"content": "Explain caching in two sentences."
}
],
"max_tokens": 512
}Gateway behavior
| Field | Behavior |
|---|---|
model | Required active model ID; use deepseek-v4.1-flash for the current launch model. |
messages | Required non-empty array. Roles: system, developer, user, assistant, tool. Developer messages are mapped to system. |
content | A string, null, or an array of text/image_url parts. Image capability must be enabled for the model. |
max_tokens | Requested output bound. Model limits still apply; the gateway uses an estimated funding check before requesting output. |
max_completion_tokens | Accepted as an alias for max_tokens; an explicitly supplied max_tokens value takes precedence. |
stream | Set true for SSE. The adapter requests usage data from the provider. |
tools, tool_choice | Forwarded to the model. Your application executes tools and sends results back. |
n | Only 1 is supported. |
store, metadata, service_tier, user | Ignored by this gateway. |
| Other generation parameters | Forwarded where provided; support and allowed values depend on the selected model. |
Response
Successful responses use the Chat Completions shape. Kryyt returns the public model ID. Exact token counts and provider-specific optional fields vary.
{
"id": "chatcmpl_example",
"object": "chat.completion",
"model": "deepseek-v4.1-flash",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Caching reuses previously computed results."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 22,
"completion_tokens": 10,
"total_tokens": 32
}
}Continue a conversation
Send the previous messages with the next request. Public API calls do not create a saved chat in the web app, and there is no public conversation_id parameter for restoring app history.
{
"model": "deepseek-v4.1-flash",
"messages": [
{
"role": "user",
"content": "What is caching?"
},
{
"role": "assistant",
"content": "Caching reuses previously computed results."
},
{
"role": "user",
"content": "Give a web example."
}
],
"max_tokens": 256
}Completion endpoint
POST /v1/completions accepts a model and prompt for a supported completion model. It returns one JSON response; streaming completions are not supported. Use Chat Completions for SSE. Additional fill-in-the-middle parameters depend on model support.
{
"model": "deepseek-v4.1-flash",
"prompt": "def greet(name):\n",
"max_tokens": 128
}