Overview
hinnflowAI is an AI model gateway: one API key reaches models from many providers, with unified billing and usage tracking. The API follows the OpenAI API format, so any OpenAI-compatible SDK, framework or client works as is.
| Item | Value |
|---|---|
| Base URL | https://api.hinnflow.com/v1 |
| Authentication | Authorization: Bearer <API key> |
| Format | JSON requests and responses, Content-Type: application/json |
| Streaming | Server-Sent Events (stream: true) |
Quick start
- Sign up and log in.
- Open Console → API keys, create a key and save it (it starts with
sk-). - Add credit in the Wallet, or redeem a top-up code.
- Set the base URL to
https://api.hinnflow.com/v1and the API key to your new key, then make your first call:
curl https://api.hinnflow.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-flash",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Introduce yourself in one sentence."}
]
}'deepseek-v4-flash with any model name from the model list.Authentication
Send your API key in the request header on every call:
Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxx- A key spends your balance. Use it on the server only; never ship it in frontend code, app bundles or public repositories.
- Create separate keys per project, each with its own spend limit, expiry, allowed models and IP allowlist.
- If a key leaks, disable or delete it in the console and it stops working immediately.
Chat completions
Generates a reply from the conversation so far. The most common endpoint. Key parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model name, see the model list |
messages | array | Yes | Conversation messages, each with a role (system / user / assistant) and content |
stream | boolean | No | Stream the response, default false |
temperature | number | No | Sampling temperature, 0–2; higher is more random |
max_tokens | integer | No | Maximum tokens to generate in the reply |
top_p | number | No | Nucleus sampling; usually tune this or temperature, not both |
tools | array | No | Tool definitions for function calling, if the model supports it |
Other parameters match the official OpenAI API and are passed through to the upstream model. Example response:
{
"id": "chatcmpl-...",
"object": "chat.completion",
"created": 1792560000,
"model": "deepseek-v4-flash",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "..." },
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 86,
"total_tokens": 110
}
}usage are what you are billed for. Every request is itemised in Console → Usage logs.Streaming
Add "stream": true and the response arrives as a stream of SSE events, ideal for chat UIs that render as they go. The stream ends with data: [DONE].
stream = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[{"role": "user", "content": "Write a short poem about the sea."}],
stream=True,
)
for chunk in stream:
delta = chunk.choices[0].delta.content if chunk.choices else None
if delta:
print(delta, end="", flush=True)The raw event stream looks like this:
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"role":"assistant","content":""}}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Waves"}}]}
data: [DONE]proxy_buffering off;), or the output will arrive all at once at the end.List models
Returns every model the key can call. If the key restricts models, only the allowed ones are listed. See the model list for pricing and availability.
curl https://api.hinnflow.com/v1/models \
-H "Authorization: Bearer $API_KEY"Other endpoints
The gateway runs on new-api and also supports these OpenAI-format endpoints. Which endpoints a given model supports is shown in its details on the model list.
| API | Method and path | Purpose |
|---|---|---|
| Responses | POST /v1/responses | OpenAI’s newer responses API |
| Embeddings | POST /v1/embeddings | Text embeddings |
| Images | POST /v1/images/generations | Image generation |
| Audio | POST /v1/audio/transcriptions, /v1/audio/speech | Speech to text and text to speech |
For full parameter details, see the new-api API reference.
Errors
Errors return a non-2xx status with an OpenAI-style body:
{
"error": {
"message": "Invalid token (request id: 2026102110...)",
"type": "new_api_error",
"code": ""
}
}| Status | Common cause | What to do |
|---|---|---|
| 400 | Invalid parameters or unknown model name | Check the request body and the model field |
| 401 | API key invalid, disabled or expired | Check the key in the console |
| 403 | Insufficient balance or key limit, model not allowed, IP not allowlisted | Top up or adjust the key settings |
| 429 | Too many requests, or upstream rate limit | Reduce concurrency and retry with exponential backoff |
| 500 / 502 / 503 | Upstream error or temporarily unavailable | Retry later; contact us if it persists |
Billing
- Most models are billed per token, with separate input and output prices listed per million tokens on the model list.
- Some models are billed per request, or tiered by time of day or context length (shown as “Dynamic pricing”).
- Requests that fail with an upstream error are not charged; any pre-held amount is returned.
- Your balance and per-request spend are in the console.
FAQ
| Question | Answer |
|---|---|
Should the base URL include /v1? | The official OpenAI SDKs need it: https://api.hinnflow.com/v1. Some clients take https://api.hinnflow.com and add /v1 themselves; follow the client’s own instructions. |
| Which tools can I use? | Any tool that accepts a custom OpenAI base URL, such as Cherry Studio, LobeChat, Dify, LangChain or Cursor. |
| I get a 401. | Make sure the header is Authorization: Bearer sk-... and the key is active in the console. |
| Streaming does not work. | Make sure you send "stream": true; behind a reverse proxy, turn proxy buffering off. |