API Documentation

60% cheaper AI API with OpenAI-compatible endpoints. Premium models at a fraction of the cost.

Connect Any App in 3 Steps

Works with any app that supports OpenAI or OpenAI Compatible connection. Just 3 simple changes:

1

Change Base URL

Set your base URL to:

https://dash.codestorex.com/v1
2

Add Your API Key

Get your API key from your dashboard after registering.

Dashboard → Get API Key
3

Choose a Model

Pick from our available models:

Browse Models →

🚀 Quick Start

Python (OpenAI SDK)

from openai import OpenAI

client = OpenAI(
    base_url="https://dash.codestorex.com/v1",
    api_key="your-api-key"
)

response = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)

cURL

curl https://dash.codestorex.com/v1/chat/completions \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

🔒 Authentication

All API requests require an API key sent in the Authorization header:

Authorization: Bearer your-api-key

Get your API key from your account dashboard.

🌐 Base URL

BASEhttps://dash.codestorex.com/v1

This is a drop-in replacement for the OpenAI API. Simply change your base_url and API key.

🤖 Available Models

We support all major AI models. Visit Models page for the full list with pricing.

Model IDProviderContextInput/1MOutput/1M
openai/gpt-4oOpenAI128k$0.60$1.80
anthropic/claude-sonnet-4.6Anthropic1000k$1.60$6.00
google/gemini-3Google1000k$0.80$5.00
deepseek/deepseek-v3.2DeepSeek164k$0.40$0.60

View all models →

💬 Chat Completions

POST/v1/chat/completions

Request Body

ParameterTypeRequiredDescription
modelstringYesModel ID (e.g. "openai/gpt-4o")
messagesarrayYesArray of message objects
streambooleanNoEnable streaming (default: false)
temperaturenumberNoSampling temperature (0-2)
max_tokensintegerNoMaximum tokens to generate

Streaming

Set stream: true to receive Server-Sent Events (SSE):

response = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}],
    stream=True
)
for chunk in response:
    print(chunk.choices[0].delta.content, end="")

💻 Claude Code Integration

Setup Claude Code

Configure Claude Code to use CodeStoreX as your API provider:

export ANTHROPIC_BASE_URL=https://dash.codestorex.com/v1
export ANTHROPIC_API_KEY=your-api-key
claude

💻 Codex CLI

Setup Codex CLI

export OPENAI_BASE_URL=https://dash.codestorex.com/v1
export OPENAI_API_KEY=your-api-key
codex

💻 Roo Code (VS Code)

Setup Roo Code

In Roo Code settings, set:

  • Provider: OpenAI Compatible
  • Base URL: https://dash.codestorex.com/v1
  • API Key: your-api-key
  • Model: openai/gpt-4o (or any model)

📝 Code Examples

Node.js

import OpenAI from 'openai';

const client = new OpenAI({
    baseURL: 'https://dash.codestorex.com/v1',
    apiKey: 'your-api-key'
});

const response = await client.chat.completions.create({
    model: 'openai/gpt-4o',
    messages: [{ role: 'user', content: 'Hello!' }]
});
console.log(response.choices[0].message.content);

💰 Pricing

All models are available at 60% off official API pricing. See Pricing page for plans and Models page for per-token costs.

FAQ

Is this compatible with OpenAI SDK?

Yes! Just change your base_url and api_key. Works with any OpenAI-compatible library.

What models are supported?

We support OpenAI, Anthropic Claude, Google Gemini, DeepSeek, and more. See all models.

Is streaming supported?

Yes, full SSE streaming is supported for all models.