Docs / Quick Start

Make the first successful API call in three minutes.

Use one OpenMagic key and one OpenAI-compatible Base URL for SDKs, coding agents, chat apps, and server-side tools. Start small, verify the response, then move the workflow into monthly quota or team routing.

The production connection path

These four steps are the default flow we want every self-serve user to understand.

1. Register

Create an account with email verification. Keep billing, API keys, usage, support, and referral rewards under the same identity.

2. Add balance or plan

Use a small wallet top-up for testing. Move to a monthly quota plan when requests become regular.

3. Create API key

Create separate keys for Codex, Claude Code, Cursor, Cline, server apps, and team automation.

4. Paste Base URL

Most OpenAI-compatible clients should use https://api.openmagic.ai/v1.

Copy the first request

Replace sk-om-... with a key from your console. Keep the request small until usage and billing show correctly.

curl https://api.openmagic.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-om-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [{"role": "user", "content": "Reply with one short sentence."}]
  }'
from openai import OpenAI

client = OpenAI(
    api_key="sk-om-...",
    base_url="https://api.openmagic.ai/v1",
)

resp = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Reply with one short sentence."}],
)

print(resp.choices[0].message.content)

Endpoint rules

Use the route shape that matches your client.

OpenAI-compatible

https://api.openmagic.ai/v1 for OpenAI SDKs, Codex-style tools, Cline, Roo, Continue, Cursor custom providers, and server apps.

Anthropic-compatible

https://api.openmagic.ai/anthropic for clients that expect Claude Messages-style requests.

Browser users

Opening https://api.openmagic.ai in a browser shows the website, docs, pricing, and console instead of the API relay.

Model names

Use visible model names listed on the model page first. Aliases can be added later for simpler marketing bundles.

Before using real workload

Do this checklist once per new user or tool.

  • Confirm the first request returns HTTP 200.
  • Check console usage and remaining quota after the request.
  • Keep each tool on a separate API key so limits and debugging stay clear.
  • Use lower-cost models for setup and testing before high-context coding tasks.
  • If streaming or tool-calling fails, verify the client route before blaming the model.

Warning: session_name(): Cannot change session name when headers already sent in /www/wwwroot/api.openmagic.ai/lib/UserSession.php on line 13

Warning: session_start(): Cannot start session when headers already sent in /www/wwwroot/api.openmagic.ai/lib/UserSession.php on line 14
Agent setup Start now