Text generation
Claude
Anthropic's Claude models, called with the OpenAI SDK.
Parsec serves Claude on the OpenAI chat completions API, so the openai SDK
works unchanged: point its base URL at Parsec and use your Parsec key.
| Model id | |
|---|---|
claude-fable-5-1 | Claude Fable 5.1: Anthropic’s most capable model, for demanding reasoning and long-horizon agentic work |
claude-opus-5-5 | Claude Opus 5.5: long-running agentic coding and knowledge work |
claude-sonnet-5-5 | Claude Sonnet 5.5: the best combination of speed and intelligence |
All three have a 1M-token context window and up to 128K output tokens.
Python
pip install openai
import os
from openai import OpenAI
client = OpenAI(
base_url="https://platform.parseclab.ai/v1",
api_key=os.environ["PARSEC_API_KEY"],
)
resp = client.chat.completions.create(
model="claude-sonnet-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Summarise the plot of Hamlet in two sentences."}],
)
print(resp.choices[0].message.content)
Streaming
Set stream=True; chunks arrive as server-sent events in the OpenAI format.
stream = client.chat.completions.create(
model="claude-sonnet-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Count to five."}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")
HTTP
curl https://platform.parseclab.ai/v1/chat/completions \
-H "Authorization: Bearer $PARSEC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "claude-sonnet-5-5", "max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello"}]}'
Usage and limits
- Requests go to Anthropic’s OpenAI-compatible endpoint, which accepts the
common chat completions fields (
messages,max_tokens,temperature,stream,tools). Anthropic-only features that this API can’t express, such as prompt-caching controls, aren’t available here. - Billing follows Anthropic’s token counts, input and output (thinking included), at the prices on the models page.