ข้ามไปยังเนื้อหา
Cosvexa – หน้าแรก Cosvexa

Blog

One OpenAI-compatible API for GPT, Claude, Gemini and open models

The Cosvexa API is OpenAI-compatible, so the official OpenAI SDKs can call GPT, Claude, Gemini and open models by changing one line: the base URL `https://cosvexa.ai/api/v1`. You switch models by changing the model string, pay from one credit balance, and can send cosvexa-auto to let Cosvexa pick the model per request. The API is available on the Pro and Team plans.

Cosvexa team · Published

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

python
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

FeatureEndpoint or field
Chat completions with streamingPOST /chat/completions, stream: true
Tool (function) callingtools, tool_choice
Image inputBase64 data: URLs in message content
Model list with prices and data policyGET /models
Image generationPOST /images/generations
Web searchPOST /web/search
BalanceGET /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.

เริ่มใช้ฟรี: ถามโมเดล Cosvexa-1 ได้ 50 คำถามต่อวัน

โมเดลหลักทุกตัวในเวิร์กสเปซเดียว ในแพ็กเกจ Free โมเดล Cosvexa-1 ตอบได้ 50 คำถามต่อวัน เริ่มใช้ได้โดยไม่ต้องใช้บัตร