Introduction
NexaAI is a developer API for connecting applications to NexaAI, built and operated by Nexa Studio. This documentation covers authentication, endpoints, and everything needed to integrate it into your own application.
What NexaAI is built on
NexaAI runs on infrastructure operated by Nexa Studio. The current development version uses an open-weight foundation model for inference, served through Nexa Studio's own API rather than a third-party AI provider's endpoint. This is an early-stage API — see the Status page for current availability.
Quickstart
Four steps to your first request.
1. Create an account
Sign up at /signup with an email and password.
2. Create an API key
From your dashboard, go to API Keys and create one. The full key is shown once — copy it immediately.
3. Make your first request
4. Read the response
{
"id": "nexa-a1b2c3d4e5f6",
"object": "nexa.chat.completion",
"created": 1789500000,
"model": "nexaai-0.1",
"output": "Hello! How can I help you today?",
"finish_reason": "stop"
}
Authentication
Every API request to /v1/chat/* requires a valid NexaAI API key, sent as a Bearer token:
Authorization: Bearer nexa_live_YOUR_API_KEY
Where keys come from
Keys are created from your dashboard's API Keys page. Each key is shown in full exactly once, at creation — after that, only a masked prefix is retrievable.
Keeping your key private
Never expose your NexaAI API key in client-side code, public repositories, browser applications, or screenshots. Treat it like a password.
Revoking a key
Revoke a key any time from the dashboard. Revocation takes effect immediately — the key is rejected on the next request.
Chat
POST /v1/chat/completions — send a list of messages, get a completion back.
Request body
{
"messages": [
{ "role": "user", "content": "Hello" }
],
"temperature": 0.7,
"max_tokens": 512
}
Parameters
messages— array of{role, content}, requiredtemperature— sampling temperature, optional, default 0.7max_tokens— max output length, optional, default 512
See the full API Reference for the response schema and error format.
Streaming
POST /v1/chat/stream — same request body as chat completions, but returns a server-sent event stream instead of waiting for the full response.
data: {"token": "Hello"}
data: {"token": "!"}
data: {"done": true}
Each line is a JSON payload. A token field is a piece of the response; done: true marks the end of the stream.
Errors
Errors return a JSON body with a detail field. NexaAI-specific errors are prefixed with an error code.
{
"detail": "NEXA-AUTH-002: invalid or revoked API key."
}
Common status codes
401— missing, invalid, or revoked API key429— daily rate limit reached for this key503— inference backend unreachable502— inference backend returned an error
API Keys
Keys are managed from your dashboard. Each key belongs to one account and can be labeled, listed, and revoked independently.
Creating a key
Sign in, open API Keys, and click Create API key. Give it a name that describes where it's used — "Production," "Local dev," etc.
Revoking a key
Revoking a key is immediate and permanent. Any application using that key will start receiving 401 errors on its next request.
Rate Limits
Each API key has a daily request limit. The current default is 200 requests per 24-hour rolling window, per key.
What happens when you hit the limit
{
"detail": "NEXA-RATE-001: daily limit of 200 requests reached."
}
Requests return 429 until the window rolls forward. There's currently no automatic retry-after — space out requests or wait for the next day.