Text generation
Stream high-quality completions from frontier-class models with low latency.
One unified API for text generation, embeddings, and tool-augmented agents. Ship your first request in under five minutes with a single key and a few lines of code.
Everything you need, one endpoint family.
Stream high-quality completions from frontier-class models with low latency.
Turn text into dense vectors for search, clustering, and semantic retrieval.
Let models call your functions and APIs with reliable, structured arguments.
Predictable status codes and retryable errors make production integrations sane.
Jump into the section you need.
Go from zero to your first successful API call in about five minutes. This guide covers installing the SDK, configuring authentication, and sending a basic completion request.
The Nexus SDK is available for Python, Node.js, and a plain HTTP API. Pick the tab below that matches your stack.
$ curl -fsSL https://get.nexus.ai/cli | sh
# verifies checksums and adds `nexus` to your PATH
$ pip install nexus-ai
# requires Python 3.9 or newer
$ npm install @nexus-ai/sdk
# requires Node 18 or newer
Create a key in the developer dashboard, then export it as an environment variable. Never hard-code keys in source control.
$ export NEXUS_API_KEY="nx_live_4f9a2c81b7d3"
$ echo $NEXUS_API_KEY
import os
client = NexusClient(api_key=os.environ["NEXUS_API_KEY"])
import { NexusClient } from "@nexus-ai/sdk";
const client = new NexusClient({ apiKey: process.env.NEXUS_API_KEY });
Send a prompt to nexus-2, our default chat model. Responses arrive as a standard completion object.
$ curl https://api.nexus.ai/v1/chat/completions \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-d '{"model":"nexus-2","messages":[{"role":"user","content":"Hello!"}]}'
reply = client.chat.completions.create(
model="nexus-2",
messages=[{"role": "user", "content": "Hello!"}],
)
print(reply.choices[0].message.content)
const reply = await client.chat.completions.create({
model: "nexus-2",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(reply.choices[0].message.content);
Practical, task-oriented walkthroughs for shipping with the API.
https://api.nexus.ai/v1/modelsLists the models currently available to your account, including context window sizes and per-token pricing tiers. Use it to populate model pickers or to detect newly released models at runtime.
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | Optional | Max models returned per page. Defaults to 20, max 100. |
after | string | Optional | Cursor from a previous response for pagination. |
capability | string | Optional | Filter by chat, embeddings, or tools. |
Returns a paginated list of model objects, each with an id, display name, and capability flags.
{
"data": [
{
"id": "nexus-2",
"display_name": "Nexus 2",
"capabilities": ["chat", "tools"],
"context_window": 200000
}
],
"has_more": true
}