ApiMonth API quickstart

Use an active ApiMonth subscription and your own API key to connect compatible clients to the model gateway.

1. Set up your account and key

Sign in, redeem a card for the model line you want to use, and create a key on the API Keys page. Copy the secret when it is created; the full key is only displayed once.

  • Base URL: https://api.apimonth.com/v1
  • Authentication: Authorization: Bearer YOUR_APIMONTH_API_KEY
  • Choose a model supported by your active subscription. A website login cookie is not a model API key.

In SDK or desktop-client settings, use the Base URL without appending /chat/completions. Compatibility depends on the endpoint and client; a custom Base URL alone does not make every provider-specific client compatible.

2. Send a Chat Completions request

This example uses a Grok subscription. Replace the placeholder with your own key. Do not publish real keys in source control or client-side code.

curl https://api.apimonth.com/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_APIMONTH_API_KEY' \
  -d '{"model":"grok-4.6","messages":[{"role":"user","content":"Explain binary search briefly."}]}'

Python with the openai SDK (pip install openai):

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.apimonth.com/v1",
    api_key=os.environ["APIMONTH_API_KEY"],
)
response = client.chat.completions.create(
    model="grok-4.6",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)

Chat Completions supports JSON and streaming SSE responses on the enabled Grok, GPT and Gemini routes. Set stream: true when your client supports streaming.

3. Use Responses with a GPT subscription

Responses is available for GPT routes, not Grok or Gemini. Its reasoning parameter is reasoning.effort; Chat Completions uses reasoning_effort. Supported effort values depend on the selected model.

curl https://api.apimonth.com/v1/responses \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_APIMONTH_API_KEY' \
  -d '{"model":"gpt-5.5","input":"Explain binary search briefly.","reasoning":{"effort":"high"}}'

Compatible GPT clients can also use wss://api.apimonth.com/v1/responses. This is a Responses WebSocket endpoint, not a realtime audio API. See the signed-in API Keys page for the message format and connection limits.

4. Check the model list for your plan

Examples of admitted route identifiers:

  • Grok: grok-4.6, grok-4.5
  • GPT: gpt-5.5, gpt-5.3-codex-spark
  • Gemini: gemini-pro-agent, gemini-3.1-pro-low, gemini-3.8-flash-high

This is not an exhaustive or permanent model list. Do not add provider prefixes or substitute display names for route identifiers. Query the gateway for the models available to your current subscription:

curl https://api.apimonth.com/v1/models \
  -H 'Authorization: Bearer YOUR_APIMONTH_API_KEY'

5. Understand quotas and failures

Token usage consumes your subscription quotas at the platform's reference rates, not necessarily an upstream provider's invoice rates. Check your account for current weekly/monthly limits, remaining quota and reset times.

  • Authentication or model-access errors: check the key, account status, subscription expiry and selected model line.
  • HTTP 429: inspect the error. It can indicate quota, concurrency or rate limits; reduce parallel requests or wait for the applicable limit to reset.
  • Upstream errors: retain the error details and request time for troubleshooting; avoid uncontrolled retry loops.

Disconnecting a client does not necessarily cancel upstream work. Completed upstream usage can still be settled against your quota.

中文接入说明

先注册、兑换对应专线的月卡,再在「API 密钥」页创建密钥。客户端选择 OpenAI 兼容接口,Base URL 填 https://api.apimonth.com/v1,API Key 填你自己的密钥。

Grok、GPT、Gemini 均可使用已开放路由的 Chat Completions;Responses 和 Responses WebSocket 仅限 GPT 专线。以 GET /v1/models 返回的可用标识为准,勿使用厂商前缀或自行拼接模型名。平台并不承诺支持厂商全部接口能力。

Open your console