Unified AI API Platform

Connect your AI workflow.
Track every token.

An AI API platform for developers and small teams. Connect your tools and applications, manage API keys and team quotas, and track usage costs in one dashboard.

International & China endpoints
Transparent token billing
Team & member quotas
Compatible API protocols
Integration example
Python SDK
from openai import OpenAI

client = OpenAI(
  base_url="https://relay.4aicode.com/v1",
  api_key="sk-4ai-...",
)

response = client.responses.create(
  model="gpt-6-astra",
  input="Hello",
)
Usage & cost overview
Demo Preview

Tokens today

384,120

Cost today

$0.428

Keys / members

4 / 6

POSTclaude-opus-5-5
1,420 tokens$0.0042200
STREAMgpt-6.1-terra
3,890 tokens$0.0012200
Team workspace · Separate keysSSE streaming

Unified API integration for your entire team's AI usage

Keep the developer tools and SDKs you know, with centralized billing and controls through 4AICode.

Codex CLI

Connect Codex CLI to the 4AICode unified endpoint to use supported models in terminal and IDE workflows.

# ~/.codex/config.toml
model_provider = "OpenAI"
openai_base_url = "https://relay.4aicode.com/v1"
model = "gpt-6-astra"
model_reasoning_effort = "xhigh"

[model_providers.OpenAI]
name = "4aicode"
base_url = "https://relay.4aicode.com/v1"
wire_api = "responses"
experimental_bearer_token = "sk-4ai-..."
requires_openai_auth = true

OpenAI-Compatible API

Point base_url to 4AICode so services, scripts, and automations share one team balance and key management.

base_url=https://relay.4aicode.com/v1
api_key=sk-4ai-...
POST /v1/responses

Team Console

Track usage by member, API Key, and model, with centralized management of quotas, billing, and permissions.

Create organization → Invite members → Assign API keys
Review token details and balance usage

Why teams choose 4AICode

Turn fragmented AI access into a measurable, assignable, and auditable API service.

Precise token-based billing

Pay only for what you use, with transparent billing for teams, members, and API Keys.

Regional endpoints

Choose international or mainland China endpoints to suit your deployment region.

Enterprise multi-tenancy

Organization-level isolation and quotas, with separate API Keys for sub-accounts and team members.

Stream passthrough

SSE is forwarded unchanged; upstream resources are released within 1 second after the client disconnects.

Full Usage Statistics

30-day usage chart; token details for each request are downloadable.

OpenAI-Compatible

Continue using the OpenAI protocol and toolchain; applications only need to standardize the base_url and API Key.

Start in three steps

Usually takes under 60 seconds.

01

Create account

Log in with email or Google. New users receive $5 in trial credits.

# Visit 4aicode.com/register
02

Generate API Key

Console → Tokens, click “Create”. The plaintext is shown only once, so be sure to save it.

sk-4ai-1a2b3c4d5e6f...
03

Replace Endpoint

Configure the OpenAI provider in Codex CLI; change base_url and API Key in the OpenAI SDK.

base_url=https://relay.4aicode.com/v1
experimental_bearer_token=sk-4ai-...

Billing & Pricing

Transparent token unit rates across all models. Choose monthly plans for bundled credits or pay-as-you-go wallet top-ups for flexible scaling.

Model Rates

All tokens and unit calls are billed strictly by actual usage. Token pricing is displayed in USD per 1M tokens.

Loading live model rates...

Rates are in USD. A dash means no separate rate is published for that field. Cache and long-context billing rules may affect the final charge. Billing details

Subscription Plans & Passes

Monthly subscriptions issue fixed quotas and soft-caps; pay-as-you-go balance never expires.

Loading live plans...

Frequently asked questions

What is 4AICode and what value does it provide?
4AICode is an AI API access and usage management platform for developers and teams. It unifies model integrations across developer tools, scripts, and applications behind a single API, offering centralized key management, team quotas, and transparent token billing in one dashboard.
Do you store my code or conversations?
Requests are processed for relay, safety checks, billing, troubleshooting, and abuse prevention. Blocked requests retain redacted input summaries; some high-risk accounts or tokens are sampled at low rates, while trusted accounts have zero sampling. Sampled summaries are kept for up to 30 days by default; blocking records and upstream risk signals are kept for up to 90 days by default.Read the Privacy Policy
How do upstream service fluctuations or policy updates affect the platform?
Model availability, response latency, and capacity limits are subject to upstream provider status and policies. The gateway handles transient errors automatically. In the event of irreversible upstream policy changes, we assist with migration or process refunds based on remaining account balances and applicable service terms.
How do I migrate from official APIs?
For the OpenAI SDK, update your base_url to https://relay.4aicode.com/v1 and supply your sk-4ai- token. For Codex CLI, declare an OpenAI provider in ~/.codex/config.toml with openai_base_url and the experimental bearer token. For Claude tools, consult the respective setup guides.
How can teams manage spend and member quotas?
Organizations support multi-tenant isolation. Admins can invite team members, generate separate API keys with individual budget caps, and monitor detailed token spending and usage curves in real time.
Which endpoint should I use?
Use relay.4aicode.com internationally, or relay.4aicode.net for tools and applications deployed in mainland China. Both endpoints provide the same API services. Latency depends on your region and upstream status; check request timings in the console.