API REFERENCE

API Documentation

Everything you need to integrate with AI Gateway by IsekaiDimension.ID.

API overview #

OpenAI-compatible gateway for chat, embeddings, and agent harness integrations. All client requests use the same base URL and sk-ixdm- API key.

API Base URL
https://ai.ixdm.co.id/v1
Health check GET
https://ai.ixdm.co.id/health
{
  "status": "ok",
  "database": "up"
}
Models are per account. Available slugs depend on your credit alias assignments. Browse yours at /user/models — there is no fixed public model catalog.

Quickstart #

Get started in three steps:

1
Sign up with Google and generate an API key from the dashboard. Free model credits are assigned automatically on first login.
2
Set the base URL to https://ai.ixdm.co.id/v1.
3
Send a request using your preferred language:
from openai import OpenAI

client = OpenAI(
    base_url="https://ai.ixdm.co.id/v1",
    api_key="sk-ixdm-xxxx"
)

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

Authentication & keys #

Every request must include a valid API key in the Authorization header:

Authorization: Bearer sk-ixdm-xxxx

API keys are generated from the user dashboard or assigned by an admin. Keys begin with the sk-ixdm- prefix.

Key rotation — Generate a new key from the dashboard and update your integration. Old keys can be revoked immediately from the key detail page.

Chat completions #

POST /v1/chat/completions

Send a chat completion request. The router selects the appropriate provider and upstream key based on the model and your client configuration.

Request parameters

ParameterTypeRequiredDescription
modelstringYesModel alias (e.g. deepseek-chat, gpt-4o)
messagesarrayYesArray of message objects with role and content
streambooleanNoEnable SSE streaming (default: false)
temperaturenumberNoSampling temperature (0-2)
max_tokensintegerNoMaximum tokens to generate
reasoning_effortstringNoReasoning level: low, medium, high

Response

{} JSON
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "model": "deepseek-chat",
  "choices": [{
    "index": 0,
    "message": {"role": "assistant", "content": "Hello! How can I help?"},
    "finish_reason": "stop"
  }],
  "usage": {"prompt_tokens": 10, "completion_tokens": 8, "total_tokens": 18}
}

Streaming #

Set "stream": true in your request to receive Server-Sent Events (SSE). Each chunk is delivered as a data: line.

from openai import OpenAI

client = OpenAI(
    base_url="https://ai.ixdm.co.id/v1",
    api_key="sk-ixdm-xxxx"
)

stream = client.chat.completions.create(
    model="deepseek-chat",
    messages=[{"role": "user", "content": "Hello!"}],
    stream=True
)
for chunk in stream:
    delta = chunk.choices[0].delta
    if delta.content:
        print(delta.content, end="", flush=True)
The stream ends with data: [DONE]. Thinking models may also emit reasoning_content deltas in the stream (see Reasoning).

Embeddings #

POST /v1/embeddings

Generate vector embeddings for text input. Uses the same authentication and model routing as chat completions.

Request parameters

ParameterTypeRequiredDescription
modelstringYesEmbedding model alias assigned to your key
inputstring or arrayYesText to embed (single string or array of strings)
cR cURL
curl https://ai.ixdm.co.id/v1/embeddings \
  -H "Authorization: Bearer sk-ixdm-xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-3-small",
    "input": "The food was delicious."
  }'
Embedding models must be configured by the operator and assigned to your account via credit aliases, same as chat models.

Tool calling #

Agent harnesses (Cursor, OpenCode, Hermes) rely on OpenAI-style function calling. Send tools in the request; the model may respond with tool_calls that your client executes and reports back via role: "tool" messages.

Request fields

FieldDescription
toolsArray of function definitions (type: "function", function.name, function.parameters)
tool_choice"auto", "none", or a specific tool
messages[].tool_callsAssistant message requesting tool execution
messages[].tool_call_idOn role: "tool" messages — links result to the call

When the model invokes a tool, finish_reason is "tool_calls":

{
  "choices": [{
    "message": {
      "role": "assistant",
      "content": null,
      "tool_calls": [{
        "id": "call_abc123",
        "type": "function",
        "function": {
          "name": "read_file",
          "arguments": "{\"path\": \"main.go\"}"
        }
      }]
    },
    "finish_reason": "tool_calls"
  }]
}
Clients always send OpenAI-format tool definitions. When the upstream provider is Anthropic, the router translates tools internally — you do not need a separate Anthropic client.

Models #

Use model aliases configured by the operator. What you see in GET /v1/models depends on your key type:

User-owned keys (created in /user/keys) return credit alias slugs you have been assigned. The owned_by field is ixdm-credit. Admin-assigned keys return ALB names and/or model routes from provider bindings. Browse accessible models and pricing at /user/models.

Common alias examples:

AliasProviderNotes
deepseek-chatDeepSeekDefault model
gpt-4oOpenAIGPT-4o
claude-sonnet-4AnthropicClaude Sonnet 4
gemini-2.0-flashGoogleGemini 2.0 Flash
llama-3.3-70bGroqLlama 3.3 70B
GET /v1/models

Returns only models your client is authorized to use.

Reasoning #

Some models support extended thinking via the reasoning_effort parameter:

ValueDescription
lowMinimal reasoning, fastest response
mediumBalanced reasoning depth
highMaximum reasoning depth, longer output

When reasoning_effort is set, the model allocates a portion of its output budget to internal reasoning before producing the final response.

Agent harnesses: thinking models may stream reasoning_content in SSE deltas. OpenCode and other native clients map this to internal reasoning parts automatically.

Agent integrations #

Connect AI coding agents and editors using your sk-ixdm- API key and the OpenAI-compatible base URL. All integrations below use the same credentials.

1
Create an API key at /user/keys after signing in.
2
Confirm your model slug at /user/models (e.g. deepseek-chat).
3
Set base URL to https://ai.ixdm.co.id/v1 in your harness config.
4
Pick a guide: Cursor, OpenCode, or Hermes.

Cursor

AI code editor — custom OpenAI-compatible model

1
Install Cursor.
2
Create an API key at /user/keys.
3
Open Settings (Ctrl+, / Cmd+,) → Models → scroll to OpenAI API.
4
Enter API Endpoint https://ai.ixdm.co.id/v1, your API key, and model name (your assigned slug).
5
Select the model in Composer (Ctrl+Shift+I) and test.

Alternative: add via ~/.cursor/models.json:

{
  "models": [{
    "name": "IXDM DeepSeek",
    "apiKey": "sk-ixdm-xxxx",
    "baseURL": "https://ai.ixdm.co.id/v1",
    "model": "deepseek-chat"
  }]
}

OpenCode

CLI + VS Code extension — @ai-sdk/openai-compatible provider

Browser / VS Code extension

1
Install OpenCode from opencode.ai.
2
Open SettingsProvidersAdd ProviderOpenAI Compatible.
3
Paste the config below and enter your API key.

CLI (terminal)

Edit ~/.config/opencode/opencode.json and store credentials in ~/.local/share/opencode/auth.json:

{
  "$schema": "https://opencode.ai",
  "provider": {
    "ixdm": {
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "https://ai.ixdm.co.id/v1",
        "name": "ixdm"
      },
      "models": {
        "deepseek-chat": {
          "id": "deepseek-chat",
          "max_tokens": 4096,
          "name": "DeepSeek Chat"
        }
      }
    }
  },
  "model": "ixdm/deepseek-chat"
}
Thinking models stream reasoning_content deltas — OpenCode maps these to internal reasoning parts automatically.

Hermes Agent

Autonomous coding agent by NousResearch

1
Install Hermes following github.com/NousResearch/hermes.
2
Create ~/.hermes/config.yaml with your API key and base URL.
3
Run hermes from your project directory.
model:
  provider: openrouter
  model: deepseek-chat
  api_base: https://ai.ixdm.co.id/v1
  api_key: sk-ixdm-xxxx

Alternatively, set the key via CLI:

hermes config set api_key "sk-ixdm-xxxx"

Anthropic SDK harnesses (future) #

Claude Code and other Anthropic SDK clients (x-api-key, POST /v1/messages) require an inbound Anthropic-compatible API surface that is not yet available on this gateway. Today, use the OpenAI-compatible integrations above (Cursor, OpenCode, Hermes). Inbound /v1/messages support is planned for a future release.

Credits & billing #

User accounts use a credit balance denominated in USD to access models. Each model is sold as a credit alias — you must be assigned an alias before you can call its slug.

ConceptDescription
CurrencyBalances and per-model rates are in USD
BalanceVisible at /user/credits in the user portal
Model accessAssigned credit aliases determine which slugs appear in GET /v1/models
PricingEach request deducts USD credits based on per-model input/output pricing (per 1M tokens)
Free tierNew users receive the operator-configured default free alias on signup
Top-upContact your operator for balance top-ups (no self-serve payment in v1)

When your balance is too low for a request, the API returns 402 Payment Required:

{} JSON
{
  "type": "insufficient_credits",
  "message": "insufficient credits. Please top up your balance and try again.",
  "code": "insufficient_credits"
}

Rate limits #

Per-key request rate limits are applied in addition to credit billing. For credit balance and model access, see Credits & billing above.

LimitScopeReset
Request rate (RPM)Per minuteRolling window
ConcurrencyPer keyOn request completion
Daily token quotaLegacy non-user keysResets at midnight UTC
When a limit is exceeded, the API returns 429 Too Many Requests with a JSON error body indicating the limit type.

Errors #

Errors return a JSON envelope:

{} JSON
{
  "type": "invalid_request_error",
  "message": "Missing required parameter: model",
  "request_id": "req-abc123"
}

Status codes

CodeMeaning
400Invalid request (missing parameters, bad JSON)
401Invalid or missing API key
402Insufficient credits — top up balance to continue
403Key not authorized for this model
404Model or endpoint not found
429Rate limit or quota exceeded
500Internal server error
502Upstream provider error
503Provider temporarily unavailable (cooldown)