Economics & Credits#
Universal Credits#
Credits apply to all models (Text, Image, Video, Audio)
Billing is per token or item generated
Optimization#
Use lightweight models (gpt-4o-mini, gemini-1.5-flash) for classification and simple tasks. Reserve flagship models (claude-3-5-sonnet, gpt-4o) for complex reasoning to reduce costs by up to 90%.
Architecture & Integration#
Base URL#
https://api.chainhub.tech/v1
Authentication#
Use the Authorization: Bearer sk-chainhub-... header.Security: Create a dedicated production API key in your dashboard. Do not expose keys in client-side code. Use a backend proxy for web applications.
Automatic Fallbacks#
Requests are automatically routed to secondary providers if the primary provider is unavailable
Model switching can be performed via environment variables without code redeployment
Best Practices#
Rate Limiting: Implement client-side rate limiting for burst traffic management
Streaming: Use stream: true for conversational interfaces to reduce Time To First Token (TTFT)
JSON Mode: Use response_format: { "type": "json_object" } for structured data extraction
Context Management: Truncate conversation history to stay within model token limits and reduce costs
Compliance & Safety#
Request data and responses are not used for model training
Requests are subject to provider safety filters (OpenAI, Google, Anthropic)
Modified at 2026-02-08 11:05:57