Introduction
Welcome to the NeXeonAI API documentation. Our platform provides a unified, high-performance interface for accessing the world's most advanced Large Language Models (LLMs) from OpenAI, Anthropic, Google Gemini, DeepSeek, xAI, and OpenRouter.
Designed for developers, the API supports multiple formats: OpenAI Chat Completions, OpenAI Responses API (GPT-5+), and Anthropic Messages API. You can integrate it into existing applications with just a few lines of code.
Base URL
https://api.nexeonai.com/v1Supported Providers
OpenAI, Anthropic, Google Gemini, DeepSeek, xAI, OpenRouter
Authentication
The API uses API keys for authentication. You can create and manage your API keys in the Dashboard.
Authentication is performed via the HTTP Authorization header. Provide your API key as a Bearer token. For Anthropic SDK compatibility, you can also use the x-api-key header.
Bearer Token (OpenAI-style)
curl https://api.nexeonai.com/v1/models \
-H "Authorization: Bearer nex-sk-..."x-api-key (Anthropic-style)
curl https://api.nexeonai.com/v1/messages \
-H "x-api-key: nex-sk-..."List Models
Lists the currently available models across all supported providers, including OpenAI GPT-5 series, Anthropic Claude, DeepSeek, and more.
{
"object": "list",
"data": [
{
"id": "gpt-5.2-chat-latest",
"object": "model",
"created": 1736841600,
"owned_by": "openai"
},
{
"id": "claude-3-5-sonnet-20241022",
"object": "model",
"created": 1729555200,
"owned_by": "anthropic"
},
{
"id": "gemini-2.5-pro",
"object": "model",
"created": 1735689600,
"owned_by": "google"
},
{
"id": "deepseek-chat",
"object": "model",
"created": 1704067200,
"owned_by": "deepseek"
},
{
"id": "grok-3",
"object": "model",
"created": 1735689600,
"owned_by": "xai"
}
]
}Chat Completions
Creates a model response for the given chat conversation. This is the primary endpoint for interacting with LLMs using the OpenAI format. Compatible with all models across all providers.
Request Body
| Parameter | Type | Description |
|---|---|---|
| model* | string | ID of the model to use (e.g., "gpt-5.2-chat-latest", "claude-3-5-sonnet-20241022"). |
| messages* | array | A list of messages comprising the conversation so far. |
| temperature | number | Sampling temperature between 0 and 2. |
| max_tokens | number | Maximum tokens to generate. Use max_completion_tokens for GPT-5+ models. |
| stream | boolean | If set, partial message deltas will be sent. |
Example
curl https://api.nexeonai.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model": "gpt-5.2-chat-latest",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
}'Responses API
The Responses API is OpenAI's new API primitive for GPT-5 and newer reasoning models. It provides better performance, built-in tools, and multi-turn conversation support.
Recommended for GPT-5+: The Responses API provides 3% better reasoning performance and up to 80% improved cache utilization compared to Chat Completions.
Request Body
| Parameter | Type | Description |
|---|---|---|
| model* | string | ID of the model (e.g., "gpt-5", "gpt-5.2-chat-latest"). |
| input* | string | array | The input to generate a response for. Can be a string or message array. |
| instructions | string | System-level instructions for the model. |
| max_output_tokens | number | Maximum tokens to generate in the response. |
| tools | array | Built-in tools like web_search, file_search, code_interpreter. |
| stream | boolean | If set, response events will be streamed. |
| store | boolean | Whether to store the response for multi-turn conversations. |
| previous_response_id | string | ID of a previous response for multi-turn context. |
Simple Example
curl https://api.nexeonai.com/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model": "gpt-5",
"instructions": "You are a helpful assistant.",
"input": "Hello!"
}'With Built-in Tools
curl https://api.nexeonai.com/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model": "gpt-5",
"input": "What is the weather in Tokyo right now?",
"tools": [{"type": "web_search"}]
}'Response Format
{
"id": "resp_nex-abc123...",
"object": "response",
"created_at": 1736841600,
"model": "gpt-5-2025-01-07",
"output": [
{
"id": "msg_nex-xyz789...",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "Hello! How can I help you today?"
}
],
"role": "assistant"
}
],
"usage": {
"input_tokens": 15,
"output_tokens": 10
}
}Messages API
The Messages API provides Anthropic SDK compatibility, allowing you to use the Claude API format with any supported model including OpenAI and DeepSeek.
Request Body
| Parameter | Type | Description |
|---|---|---|
| model* | string | ID of the model (works with any provider). |
| messages* | array | Messages in Anthropic format with role and content. |
| max_tokens* | number | Maximum tokens to generate. |
| system | string | System prompt (separate from messages). |
| temperature | number | Sampling temperature. |
| stream | boolean | If set, response will be streamed. |
Example with Claude
curl https://api.nexeonai.com/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: $API_KEY" \
-d '{
"model": "claude-3-5-sonnet-20241022",
"max_tokens": 1024,
"system": "You are a helpful assistant.",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'Example with GPT-5 (Cross-Compatible)
curl https://api.nexeonai.com/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: $API_KEY" \
-d '{
"model": "gpt-5.2-chat-latest",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Explain quantum computing."}
]
}'Response Format
{
"id": "msg_nex-abc123...",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! How can I assist you today?"
}
],
"model": "claude-3-5-sonnet-20241022",
"stop_reason": "end_turn",
"usage": {
"input_tokens": 12,
"output_tokens": 10
}
}Streaming
NeXeonAI supports streaming responses for Chat Completions, Responses API, and Messages API. When stream is set to true, the API will send server-sent events (SSE) containing partial message deltas.
SDK Usage
If you are using the official OpenAI or Anthropic SDKs, streaming is handled automatically when you pass stream=True.
Python Example (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="nex-sk-...",
base_url="https://api.nexeonai.com/v1"
)
stream = client.chat.completions.create(
model="gpt-5.2-chat-latest",
messages=[{"role": "user", "content": "Hello!"}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")Python Example (Anthropic SDK)
from anthropic import Anthropic
client = Anthropic(
api_key="nex-sk-...",
base_url="https://api.nexeonai.com"
)
with client.messages.stream(
model="claude-3-5-sonnet-20241022",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}]
) as stream:
for text in stream.text_stream:
print(text, end="")Errors
The API uses standard HTTP response codes to indicate the success or failure of an API request.
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid request body or parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 402 | Payment Required - Insufficient credits in wallet |
| 403 | Forbidden - API key lacks required permissions |
| 404 | Not Found - Model or resource not found |
| 429 | Rate Limit Exceeded - Too many requests |
| 500 | Internal Server Error |
| 502 | Bad Gateway - Upstream provider error |
| 503 | Service Unavailable - No active provider keys available |
Error Response Format
{
"error": {
"type": "invalid_request_error",
"message": "Model 'unknown-model' is not available",
"param": "model",
"code": "model_not_found"
}
}