Sign In
Open your user center to view only your own balance, access, and usage.
✦ QUICK START
Open your user center to view only your own balance, access, and usage.
Name the key, set its limits, and use every enabled model.
Set the API Base URL in your client and keep its native protocol.
Choose an agent setup or call a native API directly. Every example uses the same LuckyAPI key.
Before you startSign in to the Console, issue an API key, then replace YOUR_API_KEY in an example below.
https://luckyapi.online
Authorization: Bearer YOUR_API_KEY
Use a switcher for the easiest setup, or configure a supported client manually.
A graphical provider switcher is the simplest option for Codex and Claude Code.
Open CC Switch and add a custom provider.
Choose Codex or Claude, then enter the matching Base URL below.
Enter your LuckyAPI key and activate the provider.
Restart the target app if it was already running.
https://luckyapi.online/v1https://luckyapi.onlineYOUR_API_KEYCodex CLI and Codex Desktop use the same user-level configuration when they run as the same system user with the same CODEX_HOME.
~/.codex/config.toml
model = "gpt-5.6-sol"
model_provider = "relay"
[model_providers.relay]
name = "LuckyAPI"
base_url = "https://luckyapi.online/v1"
wire_api = "responses"
requires_openai_auth = false
experimental_bearer_token = "YOUR_API_KEY"
Set the native Claude Code endpoint and authentication token once in its user settings.
~/.claude/settings.json
{
"env": {
"ANTHROPIC_BASE_URL": "https://luckyapi.online",
"ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY"
}
}
Use Kimi Code's official KIMI_MODEL_* channel to connect one session without changing its persistent configuration.
KIMI_MODEL_NAME="k3" \
KIMI_MODEL_API_KEY="YOUR_API_KEY" \
KIMI_MODEL_PROVIDER_TYPE="kimi" \
KIMI_MODEL_BASE_URL="https://luckyapi.online/v1" \
kimi
Grok CLI uses a namespaced Base URL so its model list does not conflict with Codex.
export GROK_MODELS_BASE_URL="https://luckyapi.online/v1/grok"
export XAI_API_KEY="YOUR_API_KEY"
grok models
grok
LuckyAPI preserves each provider's native protocol. Choose the matching endpoint instead of forcing every model through one schema.
POST /v1/responsesUse the native Responses API for GPT text and agent requests.
curl https://luckyapi.online/v1/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-sol","input":"Say hello in one sentence."}'
Model catalog: GET /v1/models
POST /v1/images/generationsImage generation can take longer than text requests, so allow a longer client timeout.
curl https://luckyapi.online/v1/images/generations \
--max-time 240 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-image-2","prompt":"A red apple on a wooden table"}'
POST /v1/messagesUse the native Anthropic Messages request shape with Bearer authentication.
curl https://luckyapi.online/v1/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "anthropic-version: 2023-06-01" \
-d '{"model":"claude-sonnet-5","max_tokens":1024,"messages":[{"role":"user","content":"Hello!"}]}'
Token count: POST /v1/messages/count_tokens
POST /v1/chat/completionsKimi uses its native Chat Completions boundary and the same Bearer key.
curl https://luckyapi.online/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"k3","messages":[{"role":"user","content":"Hello!"}]}'
Model catalog: GET /v1/kimi/models
POST /v1/grok/responsesGrok uses the namespaced Responses endpoint and streams Server-Sent Events.
curl -N https://luckyapi.online/v1/grok/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-4.5","input":"Say hello in one sentence.","stream":true,"store":false}'
Model catalog: GET /v1/grok/models
POST /v1/antigravity/v1internal:streamGenerateContentGemini is exposed through the captured AntiGravity native protocol, not Google's public Gemini API schema.
curl -N https://luckyapi.online/v1/antigravity/v1internal:streamGenerateContent \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model":"gemini-3.6-flash-high",
"requestType":"agent",
"request":{"contents":[{"role":"user","parts":[{"text":"Say hello in one sentence."}]}]}
}'
No matching models.
Effective: July 24, 2026
This policy explains how LuckyAPI handles information while providing accounts, API access, usage, and billing features.
We process account email, display name, the stable account identifier supplied by Google, session and security metadata, and usage, billing, and payment-status records.
Google is used only to verify identity. LuckyAPI requests openid, email, and profile scopes, does not request offline access, and does not retain Google OAuth access or refresh tokens.
Information is used to create and protect accounts, issue local sessions, provide API service, record usage, settle charges, prevent abuse, and meet necessary security and legal obligations.
We do not sell personal information. Information is processed only as needed for hosting, payment, security, or legal compliance, and retained only for operational, security, accounting, and legal needs.
You may stop using Google sign-in. To request access, correction, or deletion of account data, use the contact channel through which your LuckyAPI access was provided.
Effective: July 24, 2026
By using LuckyAPI, you agree to these service terms.
Provide accurate account information and protect sessions, passwords, and API keys. Accounts and keys may not be sold, leased, or used for unauthorized access.
Do not use the service unlawfully, infringe rights, bypass access controls, attack systems, distribute malware, or interfere with other users or upstream services.
Billing is based on LuckyAPI records of requests, tokens, models, rates, and applicable multipliers. Top-ups, refunds, and payment status follow verified payment results and the rules shown in the product.
Upstream models and networks can change or fail. LuckyAPI may limit or suspend access for security, compliance, maintenance, or abuse risk, while making reasonable efforts to keep records accurate and service available.
Material changes update the effective date on this page. Continued use after a change means acceptance of the updated terms.
Revocation and deletion take effect immediately. Historical usage and billing remain available.
Copy and store it now. Do not share it. Revoke and replace it if exposure is suspected.
| Name | Status | Limits | Daily Token limit | Last Used | Actions |
|---|
Submit a top-up request and wait for confirmation.
Review top-up requests and their current status.
| Order Number | Amount | Status | Created | Actions |
|---|
Review every balance change and the resulting balance.
| Time | Type | Change | Balance | Description |
|---|
Review usage and cost changes for the selected time range.
Granularity is chosen automatically from the actual usage range.
Cost grouped by model for the same time range as the trend.
Daily token and cost totals.
| Date | Requests | Input | Cache Read | Cache Write | Output | Total Tokens | Cost |
|---|
Review every request, its usage and cost.
| Time | Provider | Model | Key | Status | Tokens | Cost |
|---|