Sovereign Docs

Anthropic SDK

Use Anthropic-native SDKs against Sovereign's Anthropic-compatible Messages surface.

Official docs:

Use the Anthropic-compatible surface:

Base URL: https://api.sovrun.one/anthropic
Model:    sovereign-alpha

Python

from anthropic import Anthropic
 
client = Anthropic(
    api_key="sk-sov-live_...",
    base_url="https://api.sovrun.one/anthropic",
)
 
message = client.messages.create(
    model="sovereign-alpha",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)

TypeScript

import Anthropic from "@anthropic-ai/sdk";
 
const client = new Anthropic({
  apiKey: process.env.SOVEREIGN_API_KEY,
  baseURL: "https://api.sovrun.one/anthropic",
});
 
const message = await client.messages.create({
  model: "sovereign-alpha",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Hello" }],
});

Notes

  • Anthropic’s official SDKs manage x-api-key, anthropic-version, and streaming details for you.
  • Sovereign exposes the native Messages-style route; use this if you want Anthropic request semantics instead of the OpenAI surface.

On this page