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/v1

Supported 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)

bash
curl https://api.nexeonai.com/v1/models \
  -H "Authorization: Bearer nex-sk-..."

x-api-key (Anthropic-style)

bash
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.

GET/models
json
{
  "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.

POST/chat/completions

Request Body

ParameterTypeDescription
model*stringID of the model to use (e.g., "gpt-5.2-chat-latest", "claude-3-5-sonnet-20241022").
messages*arrayA list of messages comprising the conversation so far.
temperaturenumberSampling temperature between 0 and 2.
max_tokensnumberMaximum tokens to generate. Use max_completion_tokens for GPT-5+ models.
streambooleanIf set, partial message deltas will be sent.

Example

bash
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.

POST/responses

Request Body

ParameterTypeDescription
model*stringID of the model (e.g., "gpt-5", "gpt-5.2-chat-latest").
input*string | arrayThe input to generate a response for. Can be a string or message array.
instructionsstringSystem-level instructions for the model.
max_output_tokensnumberMaximum tokens to generate in the response.
toolsarrayBuilt-in tools like web_search, file_search, code_interpreter.
streambooleanIf set, response events will be streamed.
storebooleanWhether to store the response for multi-turn conversations.
previous_response_idstringID of a previous response for multi-turn context.

Simple Example

bash
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

bash
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

json
{
  "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.

POST/messages

Request Body

ParameterTypeDescription
model*stringID of the model (works with any provider).
messages*arrayMessages in Anthropic format with role and content.
max_tokens*numberMaximum tokens to generate.
systemstringSystem prompt (separate from messages).
temperaturenumberSampling temperature.
streambooleanIf set, response will be streamed.

Example with Claude

bash
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)

bash
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

json
{
  "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)

python
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)

python
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.

CodeDescription
200Success
400Bad Request - Invalid request body or parameters
401Unauthorized - Invalid or missing API key
402Payment Required - Insufficient credits in wallet
403Forbidden - API key lacks required permissions
404Not Found - Model or resource not found
429Rate Limit Exceeded - Too many requests
500Internal Server Error
502Bad Gateway - Upstream provider error
503Service Unavailable - No active provider keys available

Error Response Format

json
{
  "error": {
    "type": "invalid_request_error",
    "message": "Model 'unknown-model' is not available",
    "param": "model",
    "code": "model_not_found"
  }
}