Mainly used to optimize your API call costs, a unique identifier is generated based on your valid domain name. Add this identifier to your headers for immediate effect.
  • For platforms: All Aihubmix API call costs for the platform are reduced, but individual users do not receive discounts.
  • For developers or regular users: All Aihubmix API calls made through your tools enjoy discounts, even if initiated by your users.
After integrating and using it, you’ll see the discounted requests reflected in your usage logs. Image

1️⃣ Call Method:

curl https://aihubmix.com/v1/responses \       
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-***" \
  -H "APP-Code:***" \
  -d '{
    "model": "gpt-4o-2024-11-20",
    "input": "Hello! Please say Hello back to me."
  }'

2️⃣ Notes

  1. Gemini’s header is slightly special, so add it like this:
Python
    client = genai.Client(
        api_key="sk-***", # 🔑 Replace with your API key generated on AiHubMix
        http_options={
            "base_url": "https://api.aihubmix.com/gemini",
            "headers": {
                "APP-Code": "***"
            }
        },
    )
  1. Claude native call also adds extra_headers:
Python
import os
import anthropic

client = anthropic.Anthropic(
    api_key="sk-***", # 🔑 Replace with your API key generated on AiHubMix
    base_url="https://aihubmix.com"
)

message = client.messages.create(
    extra_headers={"APP-Code":"***"},
    model="claude-3-7-sonnet-20250219",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Hello, Claude"}
    ]
)

print(message.content) 

3️⃣ Terms of Use for Discounts

By using the APP-Code to enjoy discounts, you agree to the following terms. AiHubMix reserves the final interpretation rights for all terms listed below.
Open-Source Product GuidelinesIf your product is open-source, it is sufficient to acknowledge AiHubMix as one of the AI model providers within the product’s functionality. The form of acknowledgment is flexible.
Closed-Source Product GuidelinesIf your product is closed-source, you must explicitly mention AiHubMix as the source of model services in the product interface, user agreement, or relevant documentation.Example statements:
  • “AI services powered by AiHubMix”
  • “AI services provided by AiHubMix”
  • Include related info on the product’s About page or Help section
Promotion ValidityThe APP-Code discount is valid until December 31, 2025. Discount policies are subject to change — please stay updated via official announcements.