Switch in one line
from openai import OpenAI
client = OpenAI(base_url="https://cosvexa.ai/api/v1", api_key="cvx_...")
res = client.chat.completions.create(
model="cosvexa-auto",
messages=[{"role": "user", "content": "Hello"}],
)
print(res.choices[0].message.content)Every response says who answered and what it cost
Responses carry x-cosvexa-model, x-cosvexa-routed-by and x-cosvexa-data-policy headers, and a cosvexa object with credits_charged. A model you name is never silently replaced.
What's not supported yet
/responses, Anthropic /messages, embeddings, audio endpoints, webhooks and per-key spending limits aren't available yet. Unsupported OpenAI fields such as top_p or seed are ignored without an error.
Frequently asked questions
Do I need separate OpenAI, Anthropic and Google keys?
No. One cvx_ key reaches every model your workspace can use, billed from the same credits as the app.
Can I call it from the browser?
No. The API doesn't allow cross-origin browser calls; call it from your server and keep the key secret.
How are tokens billed?
Each model has its own input and output rate per million tokens, listed by GET /models. 1 credit = US$0.01.