App attribution headers

Identify your app to BigModel.io with HTTP-Referer and X-Title headers, and see exactly what is recorded. Routing and price do not change.

On this page
  1. Send the headers
  2. What is recorded
  3. Where it shows up
  4. Verify the setup
  5. Troubleshooting
  6. Related

Two optional headers tell BigModel.io which app sent a request. They follow the OpenRouter convention, so apps that already send them need no changes.

Header Value Example
HTTP-Referer Your app's URL (http or https) https://your-app.example
X-Title Your app's display name Your App
X-OpenRouter-Title Used instead of X-Title when X-Title is absent Your App

The headers work on /v1/chat/completions, /v1/messages and /v1/responses. They do not change routing, model choice or price.

#Send the headers

cURL
curl https://bigmodel.io/v1/chat/completions \
  -H "Authorization: Bearer $BIGMODEL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "HTTP-Referer: https://your-app.example" \
  -H "X-Title: Your App" \
  -d '{"model":"glm-5.3","messages":[{"role":"user","content":"ping"}]}'
Python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://bigmodel.io/v1",
    api_key=os.environ["BIGMODEL_API_KEY"],
    default_headers={"HTTP-Referer": "https://your-app.example", "X-Title": "Your App"},
)
Node.js
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://bigmodel.io/v1",
  apiKey: process.env.BIGMODEL_API_KEY,
  defaultHeaders: { "HTTP-Referer": "https://your-app.example", "X-Title": "Your App" },
});

The Anthropic SDKs accept default_headers (Python) and defaultHeaders (TypeScript) the same way.

#What is recorded

For requests that succeed, BigModel.io keeps a small summary per app:

  • App key. The host name of HTTP-Referer, lowercased, with a leading www. removed. https://www.Your-App.example/settings?tab=1 is recorded as your-app.example. The path and query string are never stored.
  • Title. The X-Title value, with control characters removed and cut to 100 characters.
  • The model used.

If HTTP-Referer is missing or is not an http/https URL, the title alone identifies the app. If both are missing, nothing is recorded. Failed requests are never recorded.

Prompts and outputs are never part of attribution. See Data & privacy.

#Where it shows up

Attribution helps BigModel.io understand which apps are built on the platform. It is not shown in the console. To split your own spend by app, use a separate API key per app and filter by key on the Usage page or with GET /v1/usage.

#Verify the setup

Send the cURL example and check that it returns 200. The headers have no visible effect in the response or the console. To confirm your client actually sends them, print the outgoing request headers in your HTTP client's debug log.

#Troubleshooting

Nothing changes after adding the headers. That is expected. They do not affect routing or price, and attribution is not shown in the console.

You want per-app numbers in the console. Attribution is not shown in the console. Give each app its own API key and filter by key on the Usage page.

A request with the headers fails with 401 or 4xx. The headers are not the cause. Check the error code in Errors.

Your app name is cut off. Titles are limited to 100 characters.

Updated · View as Markdown