API features

Source Attribution

Use the X-Source header to identify your domain for public usage statistics.

The X-Source header allows you to identify your domain when making requests to Halfbill. This information is used to generate public usage statistics showing how Halfbill is being used across different websites and applications.

X-Source Header

Include the X-Source header with your domain name in your requests:

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

Domain Format

The X-Source header accepts domain names in various formats. All of the following are valid and will be normalized to the same domain:

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

All variations will be stripped down to the base domain (example.com) for aggregation purposes.

Public Statistics

Data from the X-Source header is used to generate public statistics about Halfbill usage, including:

  • Popular Domains: Which websites and applications are using Halfbill most frequently
  • Model Usage: What models are being used by different domains
  • Geographic Distribution: Where requests are coming from across different sources
  • Growth Trends: How usage is growing over time for different domains

These statistics help demonstrate the adoption and impact of Halfbill across the ecosystem.

Privacy Considerations

What's Public

  • Domain names (stripped of protocol and www prefixes)
  • Aggregated request counts and model usage
  • General geographic regions (country-level data)

What's Private

  • Individual request content or responses
  • User identifiers or personal information
  • Detailed usage patterns beyond aggregated counts
  • API keys or authentication details

Benefits

Including the X-Source header provides several benefits:

For Your Project

  • Recognition: Your domain will appear in public usage statistics
  • Credibility: Demonstrates real-world usage of your application
  • Community: Contributes to the broader Halfbill ecosystem

For the Community

  • Transparency: Shows real adoption and usage patterns
  • Inspiration: Other developers can see successful implementations
  • Growth: Helps demonstrate real-world LLM usage

While the X-Source header is optional, we strongly encourage its use to:

  • Support transparency in the Halfbill ecosystem
  • Help showcase successful integrations
  • Contribute to understanding of LLM usage patterns
  • Demonstrate the real-world impact of your application

Your participation helps build a more transparent and collaborative LLM ecosystem.

How is this guide?

On this page