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-astra
3,890 tokens$0.0116200
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 dashboard

Track usage by member, API key, and model while managing quotas, billing, and permissions centrally.

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 billing

Transparent billing for every team, member, and API key.

Regional endpoints

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

Multi-tenant teams

Organization-level isolation and quotas with separate API keys for every member.

Native streaming

SSE streams pass through directly, and upstream connections close within one second of disconnect.

Complete usage analytics

A 30-day usage chart and downloadable token details for every request.

OpenAI compatible

Keep your OpenAI tools and update only the base URL and API key.

Start in three steps

Usually takes under 60 seconds.

01

Create an account

Sign up with email or Google and receive $5 in trial credit.

# Visit 4aicode.com/register
02

Generate an API key

Open Dashboard → Tokens and select New. The secret appears once, so save it securely.

sk-4ai-1a2b3c4d5e6f...
03

Update your endpoint

Configure an OpenAI provider in Codex CLI, or update the 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.