Skip to main content

Quickstart

Get started with AICredits. Create an account, add credits, generate an API key, and make your first LLM request.

Use this page with an AI assistant

Opens a new chat with this docs URL and the correct AICredits base URLs.

Get up and running with AICredits. Access OpenAI, Anthropic, Gemini, and more with a single API key.

Overview

AICredits is a unified LLM gateway that provides an OpenAI-compatible API. This means you can use the standard OpenAI SDK with any provider — just change the base URL and API key.

Supported providers: OpenAI, Anthropic, Google Gemini, DeepSeek, Mistral, xAI, and more — 300+ models available.

Step 1: Create an Account

Sign up at aicredits.in/login using your email or Google account. No credit card required.

Step 2: Add Credits

Navigate to Dashboard → Billing and add credits using Razorpay (UPI, credit/debit card, net banking). All balances are in INR.

Credits are valid for 1 year from the date of purchase and are consumed in FIFO (first-in, first-out) order.

Step 3: Create an API Key

Go to Dashboard → API Keys and click Create New Key. Give it a name and optionally set a budget limit and expiration date.

Save Your Key

Your API key is only shown once at creation time. Copy it immediately and store it securely. It starts with sk-.

Make Your First Request

Use any OpenAI-compatible client. Just point it to the AICredits base URL and use your API key:

curl https://api.aicredits.in/v1/chat/completions \
  -H "Authorization: Bearer sk-your-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o",
    "messages": [
      { "role": "user", "content": "Hello! What can you do?" }
    ]
  }'
from openai import OpenAI

client = OpenAI(
    base_url="https://api.aicredits.in/v1",
    api_key="sk-your-key-here",
)

response = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[
        {"role": "user", "content": "Hello! What can you do?"}
    ],
)

print(response.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.aicredits.in/v1",
  apiKey: "sk-your-key-here",
});

const response = await client.chat.completions.create({
  model: "openai/gpt-4o",
  messages: [
    { role: "user", content: "Hello! What can you do?" },
  ],
});

console.log(response.choices[0].message.content);

Any Model, Same Code

Switch between providers by changing the model ID. Try openai/gpt-4o, anthropic/claude-sonnet-4.5, google/gemini-2.0-flash, or deepseek/deepseek-chat — no code changes needed.

Streaming

Enable streaming by setting stream: true. The response uses Server-Sent Events (SSE), fully compatible with the OpenAI SDK:

stream = client.chat.completions.create(
    model="openai/gpt-4o-mini",
    messages=[{"role": "user", "content": "Tell me a story"}],
    stream=True,
)

for chunk in stream:
    content = chunk.choices[0].delta.content
    if content:
        print(content, end="", flush=True)
const stream = await client.chat.completions.create({
  model: "openai/gpt-4o-mini",
  messages: [{ role: "user", content: "Tell me a story" }],
  stream: true,
});

for await (const chunk of stream) {
  const content = chunk.choices[0]?.delta?.content;
  if (content) process.stdout.write(content);
}
curl -N https://api.aicredits.in/v1/chat/completions \
  -H "Authorization: Bearer sk-your-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o-mini",
    "messages": [{"role": "user", "content": "Tell me a story"}],
    "stream": true
  }'

What's Next