Nexus AI API v2

Build with the Nexus AI API

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.

Abstract AI circuit visualization
All systems operational · 99.98% uptime

Key capabilities

Everything you need, one endpoint family.

Text generation

Stream high-quality completions from frontier-class models with low latency.

Embeddings

Turn text into dense vectors for search, clustering, and semantic retrieval.

Tool use

Let models call your functions and APIs with reliable, structured arguments.

Error handling

Predictable status codes and retryable errors make production integrations sane.

Documentation

Jump into the section you need.

Quickstart

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.

1Install the SDK

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

2Configure your API key

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 });

3Make your first request

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);
Success? You're ready to go deeper — explore the endpoint reference or follow an implementation guide below.

Developer Guides

Practical, task-oriented walkthroughs for shipping with the API.

Models

GET https://api.nexus.ai/v1/models

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

Parameters

NameTypeRequiredDescription
limitintegerOptionalMax models returned per page. Defaults to 20, max 100.
afterstringOptionalCursor from a previous response for pagination.
capabilitystringOptionalFilter by chat, embeddings, or tools.

Responses

200 OK

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
}

Create a chat completion

POST https://api.nexus.ai/v1/chat/completions

Generates a model response for a conversation. Supports streaming via server-sent events and tool calling for function execution.

Parameters

NameTypeRequiredDescription
modelstringRequiredID of the model to use, e.g. nexus-2.
messagesarrayRequiredConversation so far, with role and content per message.
temperaturenumberOptionalSampling temperature between 0 and 2. Defaults to 1.
streambooleanOptionalIf true, tokens are sent as server-sent events.
toolsarrayOptionalFunction schemas the model may call.

Responses

200 OK

Returns a completion object containing the assistant's message, finish reason, and token usage.

{
  "id": "cmpl_8f2ka01",
  "choices": [
    {
      "message": { "role": "assistant", "content": "Hello! How can I help?" },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 9, "completion_tokens": 12 }
}
$ curl https://api.nexus.ai/v1/chat/completions \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -d '{"model":"nexus-2","messages":[{"role":"user","content":"Hi"}]}'

Embeddings

GET https://api.nexus.ai/v1/embeddings

Returns vector representations of input text suitable for semantic search, clustering, classification, and retrieval-augmented generation.

Parameters

NameTypeRequiredDescription
inputstring | arrayRequiredText to embed. Pass an array to embed a batch in one call.
modelstringRequiredEmbedding model ID, e.g. nexus-embed-3.
dimensionsintegerOptionalTruncate output vectors to this many dimensions (64–3072).

Responses

200 OK

Returns one embedding object per input, each containing a 1536-dimension float vector by default.

{
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [0.0142, -0.0087, 0.0311, /* … */]
    }
  ],
  "model": "nexus-embed-3",
  "usage": { "prompt_tokens": 5 }
}

Retrieve a model

GET https://api.nexus.ai/v1/models/{id}

Fetches a single model by ID, including its context window, deprecation status, and rate-limit tier for your account.

Parameters

NameTypeRequiredDescription
idstringRequiredPath parameter — the model identifier, e.g. nexus-2.

Responses

200 OK

Returns the full model object. A 404 is returned if the ID is unknown or decommissioned.

{
  "id": "nexus-2",
  "display_name": "Nexus 2",
  "capabilities": ["chat", "tools"],
  "context_window": 200000,
  "deprecation": null
}
Copied to clipboard