Tolka Edge SymbolTolka Edge WordmarkDocs

Chat Completions

Generate model responses from a list of messages. The core Tolka Edge endpoint, fully OpenAI-compatible with streaming support.

Create a model response for a conversation using your dedicated AI Rig. This is Tolka Edge's primary endpoint and mirrors the OpenAI Chat Completions contract exactly.
POSThttps://api.tolkaedge.com/v1/chat/completions

Headers

HeaderRequiredDescription
AuthorizationYesBearer tk-live-...
Content-TypeYesapplication/json

Request body

ParameterTypeDescription
modelrequiredstringModel slug to route to. Currently supported: Qwen/Qwen3-14B.
messagesrequiredarrayThe conversation so far. Each item has a role (system, user, assistant) and content.
streambooleanStream partial deltas as server-sent events.Default: false
temperaturenumberSampling temperature between 0 and 2. Higher is more random.Default: 1
max_tokensintegerMaximum number of tokens to generate in the completion.
Tolka Edge forwards standard OpenAI fields directly to the vLLM instance running on your AI Rig. Advanced payload fields are passed through verbatim.

Message object

ParameterTypeDescription
rolerequiredstringOne of system, user, or assistant.
contentrequiredstringThe message text.

Request example

from openai import OpenAI
import os
 
client = OpenAI(
    base_url="https://api.tolkaedge.com/v1",
    api_key=os.environ.get("TOLKA_API_KEY"),
)
 
resp = client.chat.completions.create(
    model="Qwen/Qwen3-14B",
    messages=[
        {"role": "system", "content": "You are a concise assistant."},
        {"role": "user", "content": "Explain dedicated GPU inference."},
    ],
    temperature=0.7,
    max_tokens=256,
)
 
print(resp.choices[0].message.content)

Response

{
  "id": "chatcmpl-9f2b...",
  "object": "chat.completion",
  "created": 1716492000,
  "model": "Qwen/Qwen3-14B",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Dedicated GPU inference means running your AI models on isolated hardware, ensuring you don't share compute or memory with other users, which guarantees privacy and consistent latency."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 14,
    "completion_tokens": 30,
    "total_tokens": 44
  }
}

Tolka Edge Headers

Every response includes custom headers for cost and debugging:
HeaderExampleDescription
X-Tolka-Cost-INR0.0000The exact cost billed to your wallet in paise.
X-Tolka-Model-UsedQwen/Qwen3-14BThe model slug that was used.
X-Tolka-Provider-UsedrunpodThe cloud provider hosting your dedicated AI Rig.