Toknix provides complete protocol parity with OpenAI's v1 Chat Completions and Responses API. Any application, SDK, or framework designed for OpenAI can interact with Toknix models without architectural refactoring.
Chat Completions
Endpoint: POST https://api.toknix.in/v1/chat/completions
curl https://api.toknix.in/v1/chat/completions -H "Authorization: Bearer $TOKNIX_API_KEY" -H "Content-Type: application/json" -d '{
"model": "gpt-6-astra",
"messages": [
{"role": "system", "content": "You are a senior software architect."},
{"role": "user", "content": "Explain write-ahead logs in database engines."}
],
"temperature": 0.2,
"max_tokens": 1024
}'Supported Parameters
| Parameter | Type | Description |
|---|---|---|
model | string | Required. The model identifier (e.g., gpt-6-astra, claude-opus-5-5, deepseek-v4.1-flash). |
messages | array | Required. Array of message objects containing role (system, user, assistant, tool) and content. |
stream | boolean | Optional. Defaults to false. When true, tokens stream over Server-Sent Events (SSE). |
temperature | number | Optional. Sampling temperature between 0.0 and 2.0. |
max_tokens | integer | Optional. Maximum tokens to generate before stopping. |
tools | array | Optional. Array of tool objects available for the model to call. |
tool_choice | string | object | Optional. Controls whether the model must invoke a tool (none, auto, required). |
reasoning_effort | string | Optional. For reasoning models (low, medium, high). |
Function & Tool Calling
Toknix translates standard OpenAI tool definitions into provider-native tool schemas across all supported frontier models:
{
"model": "claude-sonnet-5-5",
"messages": [
{"role": "user", "content": "What is the token balance for account 8391047215?"}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_wallet_balance",
"description": "Look up real-time prepaid balance in USD for a Toknix account",
"parameters": {
"type": "object",
"properties": {
"account_id": {"type": "string", "description": "10-digit numerical PIN"}
},
"required": ["account_id"]
}
}
}
],
"tool_choice": "auto"
}Vision & Multimodal Payloads
Send images as base64 strings or publicly accessible URLs in the content array:
{
"model": "gemini-4-carbon",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "Describe the architecture diagram in this image."},
{
"type": "image_url",
"image_url": {
"url": "https://toknix.in/brand/toknix-banner.jpg"
}
}
]
}
]
}Responses API (POST /v1/responses)
Toknix supports OpenAI's modern Responses API endpoint at POST https://api.toknix.in/v1/responses. This endpoint provides structured input/output primitives optimized for modern autonomous agent loops and multimodal workflows.