New: Audio API, Embeddings & Realtime WebSocket now available!
osmAPI LogoosmAPI

Source Attribution

Use the X-Source header to identify your app in public usage statistics.

Source Attribution

The X-Source header lets you tag your requests with your domain name. This data powers public usage statistics showing how osmAPI is used across different apps and websites.

Usage

Add the X-Source header to your requests:

curl -X POST https://api.osmapi.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OSM_API_KEY" \
  -H "X-Source: example.com" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {
        "role": "user",
        "content": "Hello, how are you?"
      }
    ]
  }'

Fallback Detection

If the X-Source header is not set, the gateway will read the HTTP-Referer header as a fallback to determine the source.

Additionally, Claude Code user-agents are automatically detected and the source is set to claude.com/claude-code.

Source Format

Source values must match the pattern [a-zA-Z0-9./-]+ (alphanumeric characters, hyphens, dots, and slashes only).

Domain Format

All of these are valid and normalize to the same domain:

  • example.com
  • https://example.com
  • https://www.example.com
  • www.example.com

Public Statistics

The X-Source data is used to generate public stats including:

  • Popular Apps: Which apps and websites use osmAPI most.
  • Model Usage: Which models different domains prefer.
  • Growth Trends: How usage grows over time across the ecosystem.

Privacy

What's Public

  • Domain names (normalized)
  • Aggregated request counts and model usage
  • Country-level geographic data

What's Private

  • Request content and responses
  • User information
  • Detailed usage patterns
  • API keys

Benefits

For Your Project

  • Visibility: Your app appears in public usage stats.
  • Credibility: Demonstrates real-world usage.

For the Community

  • Transparency: Shows real adoption patterns.
  • Inspiration: Developers can discover successful integrations.

The X-Source header is optional, but we encourage using it to support transparency and showcase your integration.

How is this guide?