Kryyt / Developers

Chat Completions

POST messages to the Chat Completions endpoint and receive an assistant message.

POST /v1/chat/completions

Request

JSON request
{
  "model": "deepseek-v4.1-flash",
  "messages": [
    {
      "role": "user",
      "content": "Explain caching in two sentences."
    }
  ],
  "max_tokens": 512
}

Gateway behavior

FieldBehavior
modelRequired active model ID; use deepseek-v4.1-flash for the current launch model.
messagesRequired non-empty array. Roles: system, developer, user, assistant, tool. Developer messages are mapped to system.
contentA string, null, or an array of text/image_url parts. Image capability must be enabled for the model.
max_tokensRequested output bound. Model limits still apply; the gateway uses an estimated funding check before requesting output.
max_completion_tokensAccepted as an alias for max_tokens; an explicitly supplied max_tokens value takes precedence.
streamSet true for SSE. The adapter requests usage data from the provider.
tools, tool_choiceForwarded to the model. Your application executes tools and sends results back.
nOnly 1 is supported.
store, metadata, service_tier, userIgnored by this gateway.
Other generation parametersForwarded 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.

Illustrative response
{
  "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.

Next turn
{
  "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.

Completion request
{
  "model": "deepseek-v4.1-flash",
  "prompt": "def greet(name):\n",
  "max_tokens": 128
}