OpenAI compatible API · Attested · Public status

Request Tagging And Cost Allocation

Attach AWS style tags and OpenRouter attribution metadata to LLM requests without adding them to model prompts or provider payloads.

Verify gateway
Onebase URL to migrate
100sof models and routes
Noneprompt logs by default
Cost allocation metadata

Attribute every request without putting metadata in the prompt.

Attach up to 50 AWS style tags to Chat Completions, Responses, Messages, or Embeddings. TrustedRouter stores the effective tag set with generation metadata and keeps it out of provider request bodies.

Use tags for environment, application, team, project, cost center, customer tier, or any other non sensitive business dimension.

OpenAI Python SDKextra_body
from openai import OpenAI

client = OpenAI(
    api_key="sk-tr-v1-...",
    base_url="https://api.trustedrouter.com/v1"
)

response = client.chat.completions.create(
    model="trustedrouter/zdr",
    messages=[{
        "role": "user",
        "content": "Summarize this contract."
    }],
    user="user_123",
    extra_body={
        "session_id": "matter_456",
        "tags": {
            "environment": "production",
            "team": "legal",
            "cost-center": "legal-01"
        }
    }
)

The contract

Shape

A string map.

Send tags as a JSON object. Keys and values are case sensitive strings. Empty values are allowed. Empty keys are not.

Limits

Fifty tags per request.

Keys may contain 128 Unicode characters. Values may contain 256. The effective compact map is capped at 4 KiB.

Characters

A portable AWS style set.

Use Unicode letters, numbers, and spaces plus + - = . _ : / @. The prefixes aws: and trustedrouter: are reserved.

Defaults

Set defaults once on an API key.

POST /v1/keys and PATCH /v1/keys/{hash} accept the same tag map. Request tags override key defaults. The merged result is frozen when TrustedRouter authorizes the request, so retries and later key edits cannot rewrite historical attribution.

API key defaultscurl
curl https://trustedrouter.com/v1/keys \
  -H "Authorization: Bearer $MANAGEMENT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "production-legal",
    "tags": {
      "environment": "production",
      "team": "legal"
    }
  }'

OpenRouter attribution compatibility

Body fields

  • user identifies a stable end user
  • session_id groups related requests
  • trace carries Broadcast metadata
  • tags allocates TrustedRouter usage and cost

Headers

  • X-Session-Id
  • HTTP-Referer
  • X-OpenRouter-Title and X-Title
  • X-OpenRouter-Categories
  • X-OpenRouter-Metadata: enabled opts into router metadata

When enabled for Chat Completions or Responses, TrustedRouter returns route metadata in openrouter_metadata. It never includes credentials, tags, trace contents, prompts, or outputs.

Query usage

Filter or group activity by one tag.

Use exact matches for cost allocation. Tag filters operate on a bounded recent/date scan and the response reports whether that scan was truncated. Tag values are private to the workspace and are never included in public provider rankings.

Activity APIGET
# Individual generations
GET /v1/activity?group_by=none&tag_key=team&tag_value=legal

# Daily model and provider totals split by tag value
GET /v1/activity?group_by=tag:team
Trust boundary

Tags are router metadata, not model input.

The attested gateway validates tags before authorization. Provider adapters build separate upstream payloads that omit tags, trace metadata, session identifiers, and app attribution. Generation records contain the effective tags but never the prompt or model output.

Verify the gateway

Workspace access

Sign in

Choose a sign in method. New email and OAuth accounts include $0.10 in starter credit; wallet-only accounts start at $0.

By signing in you agree to the terms of service and privacy policy.