跳到正文

DOCS

模型

密钥在 runtime。客户端选择 model id;故障转移对 UI 透明。

模型

密钥在 runtime。客户端选择 model id;故障转移对 UI 透明。

目录行、OpenAI 与 Anthropic 密钥、SVEDA_FAILOVER 与自定义 URL。

Bring your own key

Catalog lives on the runtime, not in the JS client. Add an OpenAI (ChatGPT) or Anthropic (Claude) key, or point a row at any Responses / Anthropic-compatible URL. DeepSeek ids in the builtin list are one optional wrapper — not a lock-in. Product: models.

responses

ChatGPT / OpenAI-compatible

Protocol Responses. Your OpenAI key, or any host that speaks POST {url}/responses.

anthropic

Claude / Anthropic-compatible

Protocol Anthropic. Your Anthropic key, or any host that speaks POST {url}/messages.

deepseek-v4-flash-responses

DeepSeek wrapper (optional)

One builtin wrapper, not the product. Protocol Responses. Filled by DEEPSEEK_API_KEY if you use it.

Protocols

Custom catalog entries set protocol to responses or anthropic, plus url, key, and api_model. The HTTP client posts to:

Responses  POST {url}/responses
Anthropic  POST {url}/messages

Env

  • Catalog rows in sveda.yaml take url, protocol ( responses or anthropic ), key, and api_model. That is how you attach ChatGPT, Claude, or a self-hosted compatible API.
  • DEEPSEEK_API_KEY (or SVEDA_DEEPSEEK_API_KEY) fills the optional DeepSeek wrappers only.
  • SVEDA_DEFAULT_MODEL sets default_id.
  • SVEDA_FAILOVER is a comma-separated list of catalog ids, walked after the primary.

Failover is ordered: primary model first, then failover_ids. The client still calls session.send once. Stream event types do not change. Model failover.

# sveda.yaml — keys may also come from the environment.
default_model: gpt-4.1-mini
failover:
  - claude-sonnet
models:
  - id: gpt-4.1-mini
    label: ChatGPT
    protocol: responses
    api_model: gpt-4.1-mini
    url: https://api.openai.com/v1
    key: ""
  - id: claude-sonnet
    label: Claude
    protocol: anthropic
    api_model: claude-sonnet-4-5
    url: https://api.anthropic.com
    key: ""

# Optional DeepSeek wrapper, from the environment:
# DEEPSEEK_API_KEY=sk-...

Per-turn model

session.send may pass model (catalog id, alias, or API model name). Empty uses the runtime default. Failover still applies to that resolved primary.

await session.send('Ship the copilot.', {
  model: 'your-catalog-id',
})

Mint on the host.

POST /sveda/embed/token. The browser only sends x-sveda-embed-token.

Embed token