2-line migration · Same SDK · INR billing

The OpenAI-Compatible API That Works With Your Existing Code

Change two lines. Access Claude, Gemini, DeepSeek, Mistral, and 300+ more models. Pay in ₹ via UPI. Your LangChain, Vercel AI SDK, and OpenAI client code works without modification.

Migration takes 30 seconds

Python (OpenAI SDK)

python
# Change only these 2 lines
client = OpenAI(
  base_url="https://api.aicredits.in/v1",
  api_key="sk-your-aicredits-key"
)

# Access any model by name
response = client.chat.completions.create(
  model="claude-3-5-sonnet",
  messages=[{"role": "user", "content": "Hello"}],
)

TypeScript (OpenAI SDK)

typescript
// Change only these 2 lines
const client = new OpenAI({
  baseURL: "https://api.aicredits.in/v1",
  apiKey: "sk-your-aicredits-key",
});

// Access Claude, Gemini, DeepSeek & more
const response = await client.chat.completions.create({
  model: "gemini-1.5-flash",
  messages: [{ role: "user", content: "Hello" }],
});

Everything that works with OpenAI works with AICredits

Chat completions (streaming & non-streaming)
Tool calling / function calling
Structured outputs
Image generation
Model listing endpoint
OpenAI Python SDK
OpenAI TypeScript/JS SDK
LangChain integration
Vercel AI SDK
PydanticAI / CrewAI / LlamaIndex

Frequently Asked Questions

What does 'OpenAI-compatible' actually mean?

It means AICredits uses the exact same API format as OpenAI's chat completions endpoint. You change base_url and api_key — everything else in your code (messages format, streaming, tool definitions, response parsing) stays identical.

Does it work with LangChain?

Yes. Set the base_url to https://api.aicredits.in/v1 in your ChatOpenAI or OpenAI LangChain wrapper. LangChain doesn't need to know you've switched — it just works.

Can I access Claude and Gemini through the same OpenAI SDK?

Yes. Specify 'claude-3-5-sonnet' or 'gemini-1.5-pro' as the model field in your request. AICredits routes it to the correct provider and translates the response back to OpenAI format.

Does streaming work the same way?

Yes. Server-sent events (SSE) streaming works identically. Set stream=True in your request and parse the chunks exactly as you would with OpenAI.

What about tool calling / function calling?

Full tool calling support is available for models that support it. The request and response format is identical to OpenAI's tool_calls format.

Start using every AI model with your existing code.

Change two lines. Pay in ₹ via UPI. Access 300+ models.