Skip to Content
API ReferenceProviders

Providers

Providers are LLM accounts (API keys or OAuth connections) that agents use to generate responses. Multiple providers can be chained for automatic rate-limit fallback.

Accounts

List accounts

GET /api/providers Authorization: Bearer nxr_...

Create account (API key)

POST /api/providers Authorization: Bearer nxr_... Content-Type: application/json { "provider_type": "openai", "name": "OpenAI – Production", "auth_type": "apikey", "credentials": { "api_key": "sk-..." }, "model_name": "gpt-4o" }
FieldTypeDescription
provider_typestringProvider key (see /api/providers/catalog)
namestringDisplay name
auth_typestringapikey (default), oauth, or none
credentialsobjectAuth payload (e.g. { "api_key": "sk-..." }); stored encrypted
model_namestring?Default model override
base_urlstring?Custom endpoint (for self-hosted or proxy)
cooldown_secondsintCooldown after a rate-limit hit (default 60)

Update account

PATCH /api/providers/{provider_id} Authorization: Bearer nxr_... Content-Type: application/json { "name": "OpenAI – Backup", "credentials": { "api_key": "sk-new..." } }

Delete account

DELETE /api/providers/{provider_id} Authorization: Bearer nxr_...

Soft-delete. Use /purge for permanent deletion.

DELETE /api/providers/{provider_id}/purge Authorization: Bearer nxr_...

Restore account

PATCH /api/providers/{provider_id}/restore Authorization: Bearer nxr_...

OAuth accounts

Some providers (Claude, Gemini, Codex) authenticate via CLI OAuth. Initiate the flow:

POST /api/providers/auth/start Authorization: Bearer nxr_... Content-Type: application/json { "provider_type": "claude", "account_name": "Claude – Personal" }

Submit the code from the OAuth callback:

POST /api/providers/auth/{provider}/code/{account_name} Authorization: Bearer nxr_... Content-Type: application/json { "code": "oauth-code" }

Then create the provider record (poll GET /api/providers/auth/{provider}/status/{account_name} until ready first):

POST /api/providers/auth/{provider}/complete/{account_name} Authorization: Bearer nxr_... Content-Type: application/json { "provider_type": "claude", "account_name": "Claude – Personal" }

OAuth providers (Claude, Gemini, Codex) run the model inside their respective CLI processes. Full agentic features — sub-agent coordination, provider chaining, and token tracking — require an API key provider.

Provider catalog

List all supported provider types with their required fields:

GET /api/providers/catalog Authorization: Bearer nxr_...

Response:

The catalog includes CLI/OAuth providers (claude, gemini, codex) and ~45 API providers. A truncated sample:

Each entry carries key, name, description, auth_type (oauth / apikey / none), stream_type, base_url, requires_base_url, default_model, models, website, and category. A truncated sample:

[ { "key": "claude", "name": "Claude (Anthropic)", "auth_type": "oauth", "stream_type": "claude", "default_model": "claude-sonnet-4-6", "models": ["claude-opus-4-7", "claude-sonnet-4-6", "claude-haiku-4-5-20251001"] }, { "key": "gemini-api", "name": "Google Gemini", "auth_type": "apikey", "stream_type": "openai_compat", "default_model": "gemini-2.0-flash", "models": ["gemini-2.0-flash", "gemini-2.0-flash-lite", "gemini-1.5-flash", "gemini-1.5-pro"] }, { "key": "openai", "name": "OpenAI", "auth_type": "apikey", "stream_type": "openai_compat", "default_model": "gpt-5.5", "models": ["gpt-4.5", "gpt-4o", "gpt-4o-mini", "o4-mini", "o3"] }, { "key": "ollama", "name": "Ollama", "auth_type": "none", "stream_type": "openai_compat", "models": [] } ]

Other built-in API providers include OpenRouter, Groq, DeepSeek, Mistral, Together, Fireworks, Perplexity, Cohere, xAI, Cerebras, Azure, Bedrock, Vertex AI, OpenCode Zen, OpenCode Go, and many more.

Fallback chains

Chains define a priority-ordered list of providers. When the active provider hits its rate limit, Nexora switches to the next automatically.

List chains

GET /api/providers/chains Authorization: Bearer nxr_...

Create chain

POST /api/providers/chains Authorization: Bearer nxr_... Content-Type: application/json { "name": "Production chain", "is_default": false, "steps": [ { "provider_type": "claude", "model_name": "claude-sonnet-4-6" }, { "provider_type": "openai", "model_name": "gpt-4o" }, { "provider_type": "groq", "model_name": null } ] }

steps is an ordered array of { provider_type, model_name } entries — the chain references provider types (and optional model overrides), not individual account IDs. Nexora picks an available account of that type at run time.

Update chain

PATCH /api/providers/chains/{chain_id} Authorization: Bearer nxr_... Content-Type: application/json { "name": "Production chain", "steps": [ { "provider_type": "claude", "model_name": "claude-sonnet-4-6" }, { "provider_type": "openai", "model_name": "gpt-4o" } ] }

Delete chain

DELETE /api/providers/chains/{chain_id} Authorization: Bearer nxr_...

Assign a chain to an agent via provider_chain_id when creating or updating the agent.