Build with ApiCredits

One API key for text models across six providers. Use the OpenAI, Anthropic, or Gemini-compatible interface that already fits your application.

OpenAI-compatible base URL

https://apicredits.site/v1
Production

Make your first request

Install the OpenAI SDK or call the HTTP endpoint directly. Existing OpenAI-compatible clients only need a new API key and base URL.

terminal
curl https://apicredits.site/v1/chat/completions \
  -H "Authorization: Bearer $APICREDITS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6-luna",
    "messages": [
      {"role": "user", "content": "Explain vector databases in one paragraph."}
    ]
  }'

SDK setup: npm install openai or pip install openai. Keep the key in an environment variable and never expose it in browser code.

Authentication

Every API request must include your ApiCredits key. The recommended scheme is an Authorization bearer token.

Bearer token

Recommended for OpenAI-compatible clients.

HEADER

x-api-key

Accepted by Anthropic-compatible clients.

HEADER

x-goog-api-key

Accepted by Gemini-compatible clients.

authorization header
Authorization: Bearer $APICREDITS_API_KEY

Models

Fetch the current catalog at runtime before selecting a model. Model IDs are case-sensitive and must be sent exactly as returned.

GET/v1/models

Returns the models available to the authenticated API key.

list models
curl https://apicredits.site/v1/models \
  -H "Authorization: Bearer $APICREDITS_API_KEY"

OpenAI

6 models
  • gpt-5.6-sol
  • gpt-5.6-luna
  • gpt-5.6-terra
  • gpt-5.5
  • gpt-5.4
  • gpt-5.4-mini

Anthropic

7 models
  • claude-fable-5
  • claude-opus-4-8
  • claude-opus-4-7
  • claude-opus-4-6
  • claude-sonnet-5
  • claude-sonnet-4-6
  • claude-haiku-4-5

xAI

2 models
  • grok-4.5
  • grok-4.3

DeepSeek

2 models
  • deepseek-v4-pro
  • deepseek-v4-flash

Zhipu

2 models
  • glm-5.1
  • glm-5.2

Google

3 models
  • gemini-3.1-pro-preview
  • gemini-3-pro-preview
  • gemini-2.5-flash

Availability can depend on the API key configuration. The authenticated /v1/models response is authoritative.

Chat Completions

Use the familiar messages array for standard text conversations, tools, structured prompts, and streaming output.

POST/v1/chat/completions

Creates a model response from an ordered conversation.

chat completion
curl https://apicredits.site/v1/chat/completions \
  -H "Authorization: Bearer $APICREDITS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "messages": [
      {"role": "system", "content": "You are a concise technical assistant."},
      {"role": "user", "content": "Write a PostgreSQL health-check query."}
    ],
    "stream": false
  }'
FieldRequiredDescription
modelYesA model ID returned by /v1/models.
messagesYesOrdered system, user, assistant, and tool messages.
streamNoSet true to receive server-sent events.
temperatureNoSampling control; support and range are model-dependent.
max_tokensNoMaximum generated tokens, subject to model limits.
toolsNoTool definitions for models that support tool calling.

Responses API

Use Responses for a unified input format, instructions, tools, and modern OpenAI SDK workflows.

POST/v1/responses

Creates a response from text input or structured conversation items.

responses
curl https://apicredits.site/v1/responses \
  -H "Authorization: Bearer $APICREDITS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6-sol",
    "instructions": "Answer as a senior backend engineer.",
    "input": "Explain idempotent payment fulfillment.",
    "stream": false
  }'

Messages API

Use the Anthropic request format for Claude-oriented applications and tools that expect the Messages protocol.

POST/v1/messages

Creates a response using the Anthropic Messages format.

POST/v1/messages/count_tokens

Counts request tokens when supported by the selected route.

anthropic messages
curl https://apicredits.site/v1/messages \
  -H "x-api-key: $APICREDITS_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-fable-5",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Create a migration checklist."}
    ]
  }'

Gemini native API

Gemini SDK-compatible text requests use the v1beta route and a Google-style API key header.

POST/v1beta/models/{model}:generateContent

Generates text with the native Gemini contents format.

gemini generateContent
curl "https://apicredits.site/v1beta/models/gemini-2.5-flash:generateContent" \
  -H "x-goog-api-key: $APICREDITS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {"role": "user", "parts": [{"text": "Summarize zero-downtime deployments."}]}
    ]
  }'

Streaming

Set stream to true to receive incremental server-sent events. Keep the connection open until the protocol-specific completion event arrives.

stream chat completion
curl -N https://apicredits.site/v1/chat/completions \
  -H "Authorization: Bearer $APICREDITS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [{"role": "user", "content": "Give me five API reliability checks."}],
    "stream": true
  }'
  • Parse each SSE data: frame independently.
  • Use a read timeout long enough for model generation.
  • Do not retry after content has already been emitted.
  • Handle the error shape of the selected API protocol.

Usage and balance

Inspect the authenticated key's validity, wallet balance, request totals, token usage, and model statistics.

GET/v1/usage

Returns balance and usage information for the current API key.

usage summary
curl "https://apicredits.site/v1/usage?days=30" \
  -H "Authorization: Bearer $APICREDITS_API_KEY"

Optional query parameters include days from 1 to 90, plus start_date and end_date in YYYY-MM-DD format for model statistics.

Errors and retries

HTTP status codes communicate the failure class. Error bodies follow the OpenAI, Anthropic, or Google-compatible shape used by the endpoint.

StatusMeaningAction
400Invalid requestValidate JSON, model, messages, and field types.
401Authentication failedCheck the API key and authentication header.
402Billing unavailableTop up the wallet or review the key's quota.
403Request not permittedCheck key restrictions and endpoint access.
404Route or model unavailableRefresh /v1/models and verify the endpoint path.
429Rate or concurrency limitRetry with exponential backoff and jitter.
500Internal errorRetry once; contact support if the error repeats.
502 / 503Upstream unavailableRetry with backoff or use a fallback model.
Include the x-request-id response header when contacting support. Never send your full API key in a support message.

Ready to connect?

Choose a wallet plan, then use the delivered key with these endpoints.