Why one API instead of several
- One integration. Each provider's native API has its own request format, SDK, errors and streaming details. An OpenAI-compatible endpoint lets one client code path reach all of them.
- One key and one bill. One
cvx_key and one credit balance instead of separate accounts and invoices. - Switch with a string. Moving a feature from a flagship to a cheaper model is a configuration change, not a migration.
Three models in ten lines
from openai import OpenAI
client = OpenAI(base_url="https://cosvexa.ai/api/v1", api_key="cvx_...")
for model in ["gpt-6-luna", "claude-haiku-5-5", "gemini-4-hydrogen"]:
res = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": "Explain DNS in one sentence."}],
)
print(model, "→", res.choices[0].message.content)Create the key in the developer console (Keys tab). Keys start with cvx_, are shown only once and should only be used from your server; the API does not accept cross-origin browser calls.
Let the API choose: cosvexa-auto
Send "model": "cosvexa-auto" and Cosvexa classifies the request and picks a suitable model. The response's model field and the x-cosvexa-model header tell you which model answered. A specific model id is never silently replaced: if it fails, you get an error.
What is supported
| Feature | Endpoint or field |
|---|---|
| Chat completions with streaming | POST /chat/completions, stream: true |
| Tool (function) calling | tools, tool_choice |
| Image input | Base64 data: URLs in message content |
| Model list with prices and data policy | GET /models |
| Image generation | POST /images/generations |
| Web search | POST /web/search |
| Balance | GET /account |
The full list of endpoints, headers, error codes and limits is in the API reference.
What it costs
API calls use the same per-token prices as the app, in credits (1 credit = US$0.01). With stream_options.include_usage, the last chunk reports the tokens and credits charged. Every model page lists the API id and the current price.
What is not in the API
Council and Project modes run only in the app; through the API a request is answered by one model or by cosvexa-auto.
वारंवार विचारले जाणारे प्रश्न
Can I use the OpenAI Python or JavaScript SDK with Cosvexa?
Yes. Set base_url (Python) or baseURL (JavaScript) to https://cosvexa.ai/api/v1 and use a Cosvexa key that starts with cvx_.
How do I call Claude through an OpenAI-compatible API?
Send a Claude model id such as claude-sonnet-5-5 as model to the Cosvexa chat completions endpoint; the request and response use the OpenAI format.
Which plans include the API?
Pro and Team.