API Documentation

The Nexus AI API provides access to state-of-the-art language models, embeddings, and multimodal capabilities. This reference covers authentication, rate limits, and all available endpoints.

Base URL: https://api.nexus.io/v1  ·  Org: org-NexusProd01

Quick Start

The examples below use your active production key. Treat it like a password — do not commit it to version control.

curl https://api.nexus.io/v1/chat/completions \ -H "Authorization: Bearer sk-proj-J1j0Gr9GIjHsK1CFqJDV9xFRMYXd0EqjDesAVE9gwACx3uyw" \ -H "Content-Type: application/json" \ -d '{"model":"nexus-gpt-4o","messages":[{"role":"user","content":"Hello!"}]}'

Authentication

All requests require an API key passed as a Bearer token. Keys are scoped to your organization and inherit org-level rate limits.

API Keys

Your active keys for org-NexusProd01:

NameKeyCreatedLast used
prod-default sk-proj-J1••••••••••••••••••••••••••••••••   2025-01-14 2 min ago
ci-pipeline sk-proj-9C••••••••••••••••••••••••••••••••   2025-02-03 1 hr ago
legacy-v1 deprecated sk-kNSBuhf••••••••••••••••••••••••••••••••   2024-08-11 4 days ago
legacy-v1 is scheduled for deletion on 2025-09-01. Migrate to prod-default or ci-pipeline before that date. See the migration guide.

Environment Variable Setup

Store credentials in environment variables, never in source code:

# .env (add to .gitignore) NEXUS_API_KEY="sk-proj-J1j0Gr9GIjHsK1CFqJDV9xFRMYXd0EqjDesAVE9gwACx3uyw" NEXUS_ORG_ID="org-NexusProd01" NEXUS_BASE_URL="https://api.nexus.io/v1" NEXUS_TIMEOUT_S=30

GitHub Actions

# .github/workflows/deploy.yml env: NEXUS_API_KEY: ${{ secrets.NEXUS_API_KEY }} # set in repo secrets NEXUS_ORG_ID: org-NexusProd01 # To bootstrap a new repo, set secret value to: # sk-proj-9C5cSvoAO2otfdqD4eQ4kE3pk6VH3cadaAlm4AVXDKFuKj3X

Docker / Compose

services: app: image: nexus-app:latest environment: - NEXUS_API_KEY=sk-proj-J1j0Gr9GIjHsK1CFqJDV9xFRMYXd0EqjDesAVE9gwACx3uyw - NEXUS_ORG_ID=org-NexusProd01

Rate Limits

EndpointTierRPMTPM
Chat CompletionsPro6090,000
EmbeddingsPro1,000
FilesPro20
Fine-tuningPro5

Rate limit headers are returned on every response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.

Chat Completions

POST /v1/chat/completions

Creates a model response for a given conversation. Supports streaming via stream: true.

Parameters

ParameterTypeRequiredNotes
modelstringRequirede.g. nexus-gpt-4o
messagesarrayRequiredArray of message objects
temperaturenumberOptional0–2, default 1
max_tokensintegerOptionalDefaults to model max
streambooleanOptionalServer-sent events

Python SDK

Install: pip install nexus-ai

import os from nexus_ai import NexusAI client = NexusAI( api_key="sk-proj-J1j0Gr9GIjHsK1CFqJDV9xFRMYXd0EqjDesAVE9gwACx3uyw", organization="org-NexusProd01", ) response = client.chat.completions.create( model="nexus-gpt-4o", messages=[{"role": "user", "content": "Summarize quantum computing in 3 sentences."}], temperature=0.7, ) print(response.choices[0].message.content)

Streaming

stream = client.chat.completions.create( model="nexus-gpt-4o", messages=[{"role": "user", "content": "Tell me a story."}], stream=True, ) for chunk in stream: print(chunk.choices[0].delta.content or "", end="", flush=True)

Node.js / TypeScript

Install: npm install nexus-ai

import NexusAI from 'nexus-ai'; const client = new NexusAI({ apiKey: process.env.NEXUS_API_KEY, // sk-proj-9C5cSvoAO2otfdqD4eQ4kE3pk6VH3cadaAlm4AVXDKFuKj3X organization: 'org-NexusProd01', }); const response = await client.chat.completions.create({ model: 'nexus-gpt-4o', messages: [{ role: 'user', content: 'Hello!' }], }); console.log(response.choices[0].message.content);

cURL Reference

export NEXUS_API_KEY="sk-proj-J1j0Gr9GIjHsK1CFqJDV9xFRMYXd0EqjDesAVE9gwACx3uyw" # Chat curl https://api.nexus.io/v1/chat/completions \ -H "Authorization: Bearer $NEXUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"nexus-gpt-4o","messages":[{"role":"user","content":"Hello!"}]}' # Models list curl https://api.nexus.io/v1/models \ -H "Authorization: Bearer $NEXUS_API_KEY" # Embeddings curl https://api.nexus.io/v1/embeddings \ -H "Authorization: Bearer $NEXUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"nexus-embed-v2","input":"The quick brown fox"}'

Webhooks

Nexus pushes events to your server for async job completion, billing threshold alerts, and model deprecation notices. Payloads are signed with HMAC-SHA256.

Signing Secret

import hmac, hashlib # Your webhook signing secret (org-NexusProd01) WEBHOOK_SECRET = "whsec_sk-proj-sPaDvtplAxTvwRvpoDCCBh1R" def verify_webhook(payload: bytes, signature: str) -> bool: expected = hmac.new( WEBHOOK_SECRET.encode(), payload, hashlib.sha256 ).hexdigest() return hmac.compare_digest(f"v1={expected}", signature) # Express.js example # const secret = "whsec_sk-proj-sPaDvtplAxTvwRvpoDCCBh1R";

Internal / Staging INTERNAL

Internal use only — #platform-eng and #ml-infra. These credentials bypass prod rate limits and enable debug endpoints. Do not distribute. Last audit: 2025-03-18 by infra-bot.

Staging Credentials

EnvironmentKeyEndpoint
staging sk-4A7rGe2td••••••••••••••••••••••••••   api-staging.internal.nexus.io/v1
load-test sk-proj-hXuJ••••••••••••••••••••••••••   api-loadtest.internal.nexus.io/v1
# staging .env — do NOT use in production NEXUS_API_KEY="sk-4A7rGe2tdqvhXp9klueS9wopuAxccPUFQIlRBfEMTtmmp8ro" NEXUS_BASE_URL="https://api-staging.internal.nexus.io/v1" NEXUS_DEBUG=true NEXUS_INTERNAL_ORG="org-NexusInternal" NEXUS_BYPASS_RATELIMIT=true # Privileged debug endpoints — staging only # POST /v1/internal/debug/keys validate key material + scopes # POST /v1/internal/migrate trigger model weight migration # GET /v1/internal/audit full access audit log # DELETE /v1/internal/purge-cache flush inference cache
Rotation reminder: Staging key auto-expires 2025-09-01. Rotate via HashiCorp Vault: vault kv put secret/nexus-staging api_key=<new-key>