Quickstart
Nexith Core is OpenAI-compatible. If you already use the OpenAI SDK, you only need to change two lines.
Install the SDK
Make your first request
TypeScript / Node.js
Authentication
All API requests require an API key. Nexith API keys are prefixed with nx-.
Get an API Key
Generate a key at platform.nexith.ai/api-keys. Keys are shown only once — store them securely.
Pass the Key
Include your key in the Authorization header of every request:
Never expose your API key in client-side code or public repositories. Use environment variables or a secrets manager.
Models
Nexith currently offers one flagship model with additional models planned for release.
| Model | Context | Input Price | Output Price |
|---|---|---|---|
| nexith-core | 1M | $4.00 / 1M tokens | $20.00 / 1M tokens |
Prices are per 1 million tokens. The nexith-core model supports a 1M context window, up to 128K output tokens, and OpenAI-compatible streaming chat completions. Cached input is billed at $0.40 / 1M tokens.
Chat Completions
The Chat Completions endpoint generates a model response given a list of messages.
https://api.nexith.ai/v1/chat/completionsRequest Body
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | required | Model ID to use. Currently: nexith-core |
| messages | array | required | Array of message objects with role and content. |
| stream | boolean | optional | If true, returns a stream of SSE events instead of a single response. |
| max_tokens | integer | optional | Maximum tokens to generate. Default: model max. |
| temperature | number | optional | Sampling temperature between 0 and 2. Higher values produce more varied output. |
| top_p | number | optional | Nucleus sampling probability mass. Default: 1. |
| n | integer | optional | Number of completions to generate. Default: 1. |
| stop | string | array | optional | Up to 4 sequences where the API will stop generating further tokens. |
Streaming
When stream: true is set, the API returns a stream of Server-Sent Events (SSE). Each event contains a chunk of the response. The stream ends with a data: [DONE] message.
curl Example
SSE Event Format
Each data: line is a JSON object with a choices[0].delta.content field containing the next token(s). Accumulate these to reconstruct the full response.
Rate Limits
Every API key has per-minute rate limits applied at the gateway level.
Default Limits
| Plan | RPM | TPM |
|---|---|---|
| Free | 10 | 100,000 |
| Pro | 300 | 3,000,000 |
| Enterprise | Custom | Custom |
Response Headers
Every API response includes rate limit headers so you can track your remaining quota:
When rate limited (HTTP 429), a Retry-After header indicates how many seconds to wait before retrying:
Handling Rate Limits
Check for HTTP 429 responses and retry after the Retry-After header value. The example below uses exponential backoff:
Python SDK
The official OpenAI Python SDK works out of the box with Nexith. Pass base_url and your Nexith API key when constructing the client.
TypeScript SDK
Install the OpenAI npm package and point it at the Nexith base URL. Fully typed with TypeScript support.