TokenMarket exposes a unified external API so teams can keep one authentication method, one base URL, and one response style while calling different model capabilities.
OpenAI-style JSON request and response formats
One API key for chat, embeddings, images, audio, rerank, and video generation
Unified billing, quota checks, and request tracing headers
Authentication
Authentication and base URL
Every request uses a Bearer token. Use the official TokenMarket public base URL below.
curl -X POST "https://cloud.hopegate.ai/api/v1/video/generations" \
-H "Authorization: Bearer YOUR_TOKENMARKET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v1",
"provider": "dataeyes",
"prompt": "A paper plane flying over a lake at sunrise",
"size": "1280x720"
}'
Error handling
Error handling
TokenMarket normalizes platform and upstream failures into a consistent error envelope.
Type
Code
Meaning
invalid_request_body
REQUEST_001
Request body validation failed.
unauthorized
AUTH_001
API key is missing, invalid, or disabled.
provider_error
PROVIDER_001
The upstream provider rejected the request or the selected model is unavailable.
timeout
PROVIDER_TIMEOUT
The upstream operation timed out before completion.
FAQ
FAQ
How do I switch languages?
Use the language switcher in the page header. The route stays on the same document path and changes between English and Chinese.
Do I need different APIs for different model categories?
No. TokenMarket keeps separate unified endpoints by operation type, but they all share the same authentication pattern and base URL.
How do I choose a provider?
Add the optional provider field in the request body when you want to target a specific upstream route. If omitted, TokenMarket uses its routing policy or the model's default provider.
Why can a model return PROVIDER_001?
That means the request reached the upstream provider but failed there, for example because the model is not enabled, the provider returned an error, or the transport was interrupted.