Preparation before configuration

1. Pre-Configuration Preparation

1.1 Prepare Three Parameters

Base URL https://api\.maitoken\.com/v1
Full Chat Request URL https://api\.maitoken\.com/v1/chat/completions
Responses Request URL https://api\.maitoken\.com/v1/responses (used by Codex)
Anthropic Request URL https://api\.maitoken\.com/v1/messages (used by Claude Code)
API Key Created in the MaiToken User Console; written as <Your MaiToken Key> in examples
Model ID Copied from the Key's expanded model list or the GET /v1/models response

1.2 Create a Key and Find the Model ID

  1. Log in to the console: Open the MaiToken User Console and log in to your account.

  2. Go to API Keys: Find API Keys in the left navigation menu.

  3. Create or edit a Key: Click "Create API Key" or edit an existing Key. Copy and store the Key securely immediately after creation.

  4. View the expanded model list: Locate "Token Group" on the create or edit page. The strings shown in the expanded list under the group are the Model IDs that this Key can call.

  5. Copy the Model ID: Copy it verbatim, paying attention to letter case, hyphens, and version numbers. Do not copy the model's localized display name.

Model ID Example: If the platform displays model.id as abc-model-2026, enter abc-model-2026 in the configuration field. Do not enter family names such as "GPT" or "Claude".

1.3 How to Choose Between Base URL and Full URL

UI Field Label What to Enter What NOT to Enter
Base URL / API Host / API Address https://api\.maitoken\.com/v1 Do not append /chat/completions
Full URL / Request URL / Endpoint URL https://api\.maitoken\.com/v1/chat/completions Do not stop at /v1
Quick Rule: When you see Base, Host, or API Address, enter up to /v1; when you see Full URL, Request URL, or Endpoint URL, enter up to /v1/chat/completions.

2. Run an API Self-Check First

If the API self-check fails, do not configure the client yet. Be sure to replace the Key and Model ID in the commands below.

2.1 macOS / Linux

export MAITOKEN_API_KEY="<Your MaiToken Key>"export MAITOKEN_MODEL="<Model ID>" curl -sS https://api.maitoken.net/v1/models \  -H "Authorization: Bearer $MAITOKEN_API_KEY"
curl -sS https://api.maitoken.net/v1/chat/completions \  -H "Authorization: Bearer $MAITOKEN_API_KEY" \  -H "Content-Type: application/json" \  -d '{"model":"'"$MAITOKEN_MODEL"'","messages":[{"role":"user","content":"Reply OK only"}],"stream":false}'

2.2 Windows PowerShell

$env:MAITOKEN_API_KEY="<Your MaiToken Key>"$env:MAITOKEN_MODEL="<Model ID>" Invoke-RestMethod https://api.maitoken.net/v1/models `  -Headers @{Authorization="Bearer $env:MAITOKEN_API_KEY"}
$body = @{  model = $env:MAITOKEN_MODEL  messages = @(@{role="user"; content="Reply OK only"})  stream = $false} | ConvertTo-Json -Depth 5 Invoke-RestMethod https://api.maitoken.net/v1/chat/completions `  -Method Post `  -Headers @{Authorization="Bearer $env:MAITOKEN_API_KEY"} `  -ContentType "application/json" `  -Body $body

2.3 How to Interpret the Results

Model list returned The Key is valid and has permission to read the model list.
OK or normal response returned The Chat Completions endpoint is working; you can proceed to configure your client.
401 / Unauthorized The Key is incorrect, expired, or the Authorization header format is invalid.
404 / Not Found The URL path is incorrect, commonly caused by duplicating /v1/v1.
model_not_found The Model ID is incorrect, or this Key does not have permission for that model.