Integrate a project

Integration is a base-URL change. Your API keys never move, and nothing else about your code changes. The /p/<project> segment is how calls are grouped on the dashboard.

The pattern

Every gateway route looks like one of these:

routes
http://localhost:4321/p/<project>/openai/v1        →  api.openai.com
http://localhost:4321/p/<project>/anthropic        →  api.anthropic.com
http://localhost:4321/p/<project>/gemini           →  generativelanguage.googleapis.com
# also: openrouter, mistral, deepseek, xai, groq, together, ollama, + custom

Prefer not to touch the URL in code? Set the SDK's standard base-URL env var instead (OPENAI_BASE_URL, ANTHROPIC_BASE_URL, GOOGLE_GEMINI_BASE_URL) and change nothing else.

OpenAI (and OpenAI-compatible)

Python
from openai import OpenAI
client = OpenAI(base_url="http://localhost:4321/p/invoice-bot/openai/v1")

Anthropic

python
from anthropic import Anthropic
client = Anthropic(base_url="http://localhost:4321/p/invoice-bot/anthropic")

Google Gemini

python
from google import genai
client = genai.Client(http_options={"base_url": "http://localhost:4321/p/invoice-bot/gemini"})

Optional thin SDKs

They do nothing but set those env vars for you - use them or skip them. Install with pip install aicc-sdk or npm install @ai-command-center/sdk.

python
import aicc
aicc.init(project="invoice-bot")   # before you construct any client
js
import { init } from "@ai-command-center/sdk";
init({ project: "support-bot" });

Batch jobs, non-LLM spend & unsupported providers

Can't route through the proxy? Report usage directly and it's priced and dashboarded the same way:

bash
curl -X POST http://localhost:4321/api/track \
  -H "Content-Type: application/json" \
  -d '{"project":"nightly-job","provider":"openai","model":"gpt-4o","tokensIn":52000,"tokensOut":9000}'

This also covers spend that isn't tokens at all - STT/TTS, telephony minutes, image generation, batch imports. Set costUsd yourself, reuse the LLM calls' trace id to see the whole pipeline as one session, and backdate with ts. Details and a voice-agent example: HTTP API → /api/track.

Grouping without a path prefix

If you can't change the path, send a header instead: x-aicc-project: invoice-bot.

Traces & prompt versions

Two more optional headers unlock the Traces and Prompts views: x-aicc-trace (a shared id across the calls in one request or agent run) and x-aicc-prompt / x-aicc-prompt-version. Full details in Traces, prompts & budgets.

With auth enabled, the /p/<project> segment becomes /k/<gateway-key> - the key both authenticates the call and assigns its project. Run npx ai-command-center snippets --project <name> to print the exact URLs with the key filled in.