SupaNexus

Endpoints — Markdown source

Raw Markdown for copying or feeding to AI agents.

> **AI Agents**: Index `/api/llms.txt` | Full EN `/api/llms-full-en.txt` | Full ZH `/api/llms-full-zh.txt` | OpenAPI `/api/openapi.yaml`
> Endpoints (Global): `https://api.supanexus.ai` | CN: `https://api.supanexus.io`

# Endpoints

SupaNexus provides two endpoints that share the **same account and API key**. Request paths, authentication, model list, and billing are identical — use either.

**Endpoint hosts do not include `/v1`.** Add `/v1` only on concrete API paths (e.g. `/v1/chat/completions`) or in the OpenAI SDK `base_url`.

## Base URLs

| Site | Base URL | When to use |
|------|----------|-------------|
| Global | `https://api.supanexus.ai` | Default endpoint |
| CN | `https://api.supanexus.io` | Backup endpoint |

## How to choose

- Use Global by default.
- If Global is unreachable or unstable, switch to the CN backup endpoint.
- When switching, change only the endpoint host (and append `/v1` where the SDK requires it). API key and other code stay the same.

## OpenAI SDK

OpenAI SDK `base_url` must append `/v1` to the endpoint host:

```python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.supanexus.ai/v1",  # or "https://api.supanexus.io/v1"
    api_key="your-api-key",
)
```

## Anthropic SDK

Anthropic SDK `base_url` is the endpoint host (**no** `/v1`):

```python
import anthropic

client = anthropic.Anthropic(
    api_key="sk-snx-...",
    base_url="https://api.supanexus.ai",  # or "https://api.supanexus.io"
)
```

## Related

- [Quickstart](./quickstart.md)
- [OpenAI SDK Integration](./openai-sdk-integration.md)
- [Anthropic SDK Integration](./anthropic-sdk-integration.md)