Developer documentation

Chat Completions API OpenAI compatible

Connect Ox Alpha to your application with one OpenAI-compatible endpoint. Send a conversation, optionally enable reasoning, and receive a structured chat completion.

01 / Quickstart

Make your first completion.

Send a POST request to the Chat Completions endpoint. Ox Alpha uses the model identifier stealth/ox-alpha.

POSThttps://tokenra.io/v1/chat/completions
Use a server-side environment variable for your API key. Never put a production API key in browser JavaScript, public repositories, or client-side bundles.
02 / Authentication

Set the required headers.

Pass your Tokenra API key as a Bearer token. The request body must be JSON. HTTP-Referer and X-Title are optional metadata headers for provider rankings.

Authorization
Bearer $TOKENRA_API_KEY
Required API authentication token.
Content-Type
application/json
Required request content type.
HTTP-Referer
https://your-site.com
Optional — your site URL, for rankings.
X-Title
Your App Name
Optional — your site name, for rankings.
Model
stealth/ox-alpha
Set in the JSON request body.
03 / Request body

Send messages and enable reasoning.

Use an array of messages in the familiar OpenAI chat format. Set reasoning.enabled to true when you want the model to return reasoning details.

REQUEST EXAMPLE · JSON
{
  "model": "stealth/ox-alpha",
  "messages": [
    {
      "role": "user",
      "content": "What AI model are you?"
    }
  ],
  "reasoning": {
    "enabled": true
  }
}
04 / Parameters

Request parameters.

Only model and messages are required for a basic completion. Add reasoning and generation controls as your application needs them.

NameTypeDefaultDescription
model requiredstringSet to stealth/ox-alpha.
messages requiredarrayConversation messages with a role and content.
reasoningobjectControls reasoning behavior. Set enabled to true to request reasoning details.
max_tokensintegerMaximum number of tokens the model may generate.
temperaturefloat1Controls sampling variety in the generated response.
top_pfloat0.95Limits sampling to the most likely cumulative token mass.
toolsarrayTool definitions following the OpenAI tool calling format.
tool_choicestring or objectControls whether and which tool the model calls.
top_kinteger0Limits the number of candidate tokens considered at each step.
response_formatobjectRequests a specific output format when supported.
05 / Response body

Read the assistant response.

A successful completion contains the generated message in choices[0].message.content. When reasoning is enabled, inspect reasoning and reasoning_details in the message.

200 RESPONSE · JSON
{
  "id": "gen-1787298854-P6E9CphWvR6pCRwxXa3j",
  "object": "chat.completion",
  "created": 1787298854,
  "model": "stealth/ox-alpha",
  "provider": "Stealth",
  "choices": [
    {
      "index": 0,
      "finish_reason": "stop",
      "message": {
        "role": "assistant",
        "content": "I am **ox-alpha**, an AI language model developed by an undisclosed organization.\n\nIs there something I can help you with today?",
        "refusal": null,
        "reasoning": "The user is asking about my identity as an AI model. According to my instructions, I should identify myself strictly as \\"ox-alpha\\", developed by an undisclosed organization.",
        "reasoning_details": [
          {
            "type": "reasoning.text",
            "text": "The user is asking about my identity as an AI model...",
            "format": "unknown",
            "index": 0
          }
        ]
      }
    }
  ],
  "usage": {
    "prompt_tokens": 93,
    "completion_tokens": 62,
    "total_tokens": 155,
    "cost": 0,
    "is_byok": false,
    "prompt_tokens_details": { "cached_tokens": 64, "cache_write_tokens": 0, "audio_tokens": 0, "video_tokens": 0 },
    "cost_details": { "upstream_inference_cost": 0, "upstream_inference_prompt_cost": 0, "upstream_inference_completions_cost": 0 },
    "completion_tokens_details": { "reasoning_tokens": 0, "image_tokens": 0, "audio_tokens": 0 }
  }
}
Primary output

choices[].message.content

The generated assistant response for the requested completion.

Reasoning output

choices[].message.reasoning

Reasoning text returned when reasoning is enabled and available.

Usage

usage.total_tokens

Total tokens consumed by the request, including prompt and completion tokens.

Completion state

choices[].finish_reason

Why generation stopped, such as stop or a token limit.