- Ox Alpha chat completions use the
stealth/ox-alphamodel identifier. - Authentication requires a Tokenra API key sent as a Bearer token.
- Request format follows the familiar OpenAI-style messages array.
- Reasoning mode is enabled with
reasoning.enabled: truewhen supported. - Response data appears primarily in
choices[0].message.content.
Ox Alpha chat completions at a glance
Ox Alpha chat completions provide a server-side API interface for sending conversational messages to the stealth/ox-alpha model. The basic request uses JSON and requires two fields: model and messages. Optional controls can adjust reasoning, output length, sampling, and tool behavior.
The integration is designed around a familiar chat-completion structure. Each message includes a role and content, allowing applications to send user prompts and, when needed, system or assistant context. This makes the endpoint suitable for chat interfaces, internal tools, automation workflows, and structured application features.
The official Ox Alpha API documentation describes the required request structure, authentication headers, available parameters, and successful response format.
Model
Use the exact identifier stealth/ox-alpha in the request body.
Messages
Send an array of conversation objects with a role and content value.
Reasoning
Request provider-supplied reasoning fields by enabling the reasoning option.
Response
Read the generated answer from choices[0].message.content.
| Requirement | Value | Purpose |
|---|---|---|
| Model | stealth/ox-alpha | Selects the Ox Alpha model |
| Messages | Array | Supplies the conversation context |
| Content type | JSON | Formats the request body |
| Authentication | Bearer token | Authorizes the API call |
Start with only model and messages. Add generation controls or tools after the basic completion returns the expected response.
Authentication and first request
The API key should remain on a trusted server or protected backend. Do not place a production key in browser JavaScript, public repositories, mobile bundles, or other client-side packages that users can inspect.
Authentication uses a Tokenra API key in the Authorization header. The value follows the Bearer token convention. Requests should also declare JSON content with Content-Type: application/json.
The HTTP-Referer and X-Title headers are optional metadata. They can identify the application or provide provider-ranking context, but they are not listed as required headers for a basic request.
Store the API key securely
Save the Tokenra API key in a server-side environment variable such as TOKENRA_API_KEY. Keep the key outside source control and avoid printing it in logs.
Prepare the JSON body
Set model to stealth/ox-alpha and provide a messages array. Each message should include a valid role and text content.
Send the POST request
Make a server-side POST request to the Chat Completions endpoint documented by Ox Alpha. Include the Bearer authorization header and JSON content type.
Read the assistant message
Parse the JSON response and inspect choices[0].message.content for the generated completion.
A minimal JavaScript pattern can keep the endpoint configurable without hard-coding deployment details:
const response = await fetch(process.env.CHAT_COMPLETIONS_URL, {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TOKENRA_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "stealth/ox-alpha",
messages: [
{
role: "user",
content: "What AI model are you?"
}
]
})
})
const data = await response.json()
const answer = data.choices?.[0]?.message?.content
| Header | Required status | Recommended value |
|---|---|---|
Authorization | Required | Bearer ${TOKENRA_API_KEY} |
Content-Type | Required | application/json |
HTTP-Referer | Optional | Your application URL |
X-Title | Optional | Your application name |
Never expose a production API key in browser code, public Git repositories, client-side bundles, screenshots, or error messages.
Request parameters and generation controls
The required request body is intentionally small, but Ox Alpha supports several optional controls. Use them selectively because each parameter changes how the application handles generation.
max_tokens limits the maximum number of generated tokens. temperature changes sampling variety, while top_p limits selection to a cumulative probability range. The documented defaults are 1 for temperature and 0.95 for top-p. top_k defaults to 0 and can limit the number of candidate tokens considered at each generation step.
Reasoning is controlled through an object rather than a standalone Boolean. Set reasoning.enabled to true when the application needs the provider to return reasoning-related fields and the selected service supports them.
| Parameter | Type | Documented default | Use |
|---|---|---|---|
model | String | None | Required model identifier |
messages | Array | None | Required conversation input |
reasoning | Object | None | Controls reasoning behavior |
max_tokens | Integer | None | Limits generated output length |
temperature | Float | 1 | Controls sampling variety |
top_p | Float | 0.95 | Limits cumulative token probability |
top_k | Integer | 0 | Limits candidate tokens per step |
tools | Array | None | Defines OpenAI-format tools |
tool_choice | String or object | None | Controls tool selection |
Predictable Output
Use a lower temperature when consistency matters more than stylistic variation.
Longer Answers
Set max_tokens according to the response size your interface can display and store.
Tool Workflows
Provide tools and configure tool_choice only when the application has a tool execution path.
A practical configuration should match the task:
- For classification or extraction, favor constrained output and a conservative sampling setup.
- For brainstorming, allow more sampling variety while keeping a reasonable output limit.
- For tool calling, define the tool schema clearly and validate returned arguments before execution.
- For reasoning-enabled requests, decide which returned fields should be stored, displayed, or omitted.
The documentation lists temperature, top_p, and top_k as separate controls. Change one sampling strategy at a time during testing so you can identify its effect.
Response format and application handling
A successful response uses the chat-completion structure. The generated assistant message is located at choices[0].message.content. The response also includes an identifier, object type, creation timestamp, selected model, provider information, completion status, and usage details.
When reasoning is enabled and available, inspect choices[0].message.reasoning and choices[0].message.reasoning_details. These fields may contain provider-supplied reasoning output and should be handled according to the privacy, security, and product requirements of your application.
The finish_reason field explains why generation stopped. A value such as stop indicates normal completion, while a token-limit state signals that the configured output limit may have been reached.
| Response path | Meaning | Application use |
|---|---|---|
id | Completion identifier | Trace logs and support requests |
model | Model used for generation | Confirm routing and configuration |
choices[0].message.content | Main assistant response | Display or process generated text |
choices[0].message.reasoning | Reasoning text when available | Handle selectively and securely |
choices[0].message.reasoning_details | Structured reasoning details | Inspect only when required |
choices[0].finish_reason | Completion stop state | Detect normal or limited output |
usage.total_tokens | Total prompt and completion tokens | Monitor request consumption |
usage.cost | Reported request cost | Review service usage metadata |
Use defensive parsing rather than assuming every optional property is present. A valid application should handle an empty choices array, a missing content value, an unavailable reasoning field, and an unexpected finish state without crashing.
Treat choices[0].message.content as the primary output, and check optional reasoning fields only after confirming they exist in the response.
Production checklist and FAQ
Before releasing an Ox Alpha integration, verify the request path, secret handling, response parser, and operational safeguards. Test both ordinary completions and edge cases such as empty output, long prompts, tool calls, or incomplete generation.
Production Readiness Checklist:
- Store the Tokenra API key in a server-side environment variable
- Use the exact stealth/ox-alpha model identifier
- Send model and messages as a JSON request body
- Parse choices[0].message.content defensively
- Review reasoning and usage fields before exposing them to users
| Test area | What to verify | Passing condition |
|---|---|---|
| Authentication | Bearer token and secret storage | Request works without exposing credentials |
| Request body | Model and messages fields | JSON matches the documented structure |
| Generation | Limits and sampling controls | Output fits the product requirement |
| Reasoning | Optional reasoning fields | Missing fields do not break parsing |
| Completion state | finish_reason | Application handles normal and limited output |
| Usage | Token metadata | Logs support monitoring without leaking prompts |
For ongoing maintenance, keep the endpoint configuration separate from application logic. Log request identifiers and completion states where appropriate, but avoid recording sensitive prompts, API keys, or provider-returned reasoning unless there is a clear operational need.
Q: What model identifier does Ox Alpha chat completions require?
The documented model identifier is `stealth/ox-alpha`. A basic request also requires a `messages` array.
Q: Which headers are required for an Ox Alpha request?
Use a Bearer Tokenra API key in the `Authorization` header and send the body with `Content-Type: application/json`. `HTTP-Referer` and `X-Title` are optional.
Q: Where is the generated response located?
Read the main assistant response from `choices[0].message.content`. Also inspect `finish_reason` when your application needs to distinguish normal completion from a limit.
Q: How does reasoning work in the request?
Add a `reasoning` object with `enabled` set to `true`. When reasoning is available, related values may appear in the assistant message under `reasoning` and `reasoning_details`.
Recheck the official Ox Alpha API documentation on 2026-08-22 and whenever your provider configuration changes.