Use the OpenAI API through this endpoint通过这个地址调用 OpenAI API
Keep your OpenAI API key. Change only the Base URL. Every /v1 endpoint works unchanged, including streaming.保留你自己的 OpenAI API Key,只改 Base URL。所有 /v1 接口原样可用,包括流式输出。
Base URL
https://api.aiinflow.com/v1
- Your key, your billing用自己的 Key、自己付费
- No signup, no SDK, no client install无需注册、无需 SDK、调用端无需安装
- Streaming (SSE) token by tokenSSE 逐 token 流式返回
- No logs of keys, prompts or replies不记录 Key、提示词或回复
Three steps三步用起来
- Open your client settings打开调用端设置
Any app, SDK or agent with a "Base URL", "API Base" or "OpenAI-compatible endpoint" field.任何带有 “Base URL”“API Base” 或 “OpenAI 兼容接口” 设置的应用、SDK 或 Agent。
- Paste the Base URL填入 Base URL
Exactly as shown above, ending in
/v1.照上面原样填写,以/v1结尾。 - Keep your API keyAPI Key 不变
Sent as
Authorization: Bearer sk-…, exactly as with OpenAI.照常以Authorization: Bearer sk-…发送,与直连 OpenAI 相同。
Examples示例
# Official OpenAI SDKs and most tools read these. No code change needed. export OPENAI_BASE_URL=https://api.aiinflow.com/v1 export OPENAI_API_KEY=sk-... # your own key
from openai import OpenAI
client = OpenAI(base_url="https://api.aiinflow.com/v1") # api_key from OPENAI_API_KEY
r = client.responses.create(model="gpt-4.1-mini", input="Hello")
print(r.output_text)
c = client.chat.completions.create(
model="gpt-4.1-mini",
messages=[{"role": "user", "content": "Hello"}],
stream=True,
)
for chunk in c:
print(chunk.choices[0].delta.content or "", end="")import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.aiinflow.com/v1" }); // apiKey from OPENAI_API_KEY
const r = await client.responses.create({ model: "gpt-4.1-mini", input: "Hello" });
console.log(r.output_text);
const e = await client.embeddings.create({ model: "text-embedding-3-small", input: "Hello" });
console.log(e.data[0].embedding.length);# Streaming Responses API (-N disables curl's buffering) curl -N https://api.aiinflow.com/v1/responses \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-4.1-mini","input":"Say hello","stream":true}' # Chat Completions curl https://api.aiinflow.com/v1/chat/completions \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-4.1-mini","messages":[{"role":"user","content":"Hello"}]}'
# Decisions API: questions in, probabilities out curl https://api.aiinflow.com/v1/decisions \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-6-luna","input":"The mug arrived cracked, I want my money back", "questions":[{"type":"predicate","name":"refund_requested", "instructions":"Does the customer ask for a refund?"}]}' # → {"answers":[{"type":"predicate","name":"refund_requested","probability":1.0}], ...}
Supported APIs支持的接口
Chat Completions✓ SSE
POST /v1/chat/completionsResponses✓ SSE
POST /v1/responsesEmbeddings✓
POST /v1/embeddingsDecisions✓
POST /v1/decisionsModels✓
GET /v1/modelsEverything else under /v1其他 /v1 接口forwarded as-is原样转发
images · audio · files · batches · moderations · vector_stores …Realtime (WebSocket)not supported不支持
/v1/realtimeFor AI agents给 AI Agent
Paste this into an agent's instructions, or point it at https://api.aiinflow.com/llms.txt (plain text, same content).把下面这段放进 Agent 的指令里,或者让它读取 https://api.aiinflow.com/llms.txt(纯文本,内容相同)。
Use the OpenAI API through https://api.aiinflow.com/v1 instead of https://api.openai.com/v1. - Set the OpenAI base URL to https://api.aiinflow.com/v1 (or env OPENAI_BASE_URL). Change nothing else. - Authenticate with the user's own key: header "Authorization: Bearer $OPENAI_API_KEY". - Request and response bodies are identical to the OpenAI API; streaming (SSE) works. - Supported: every /v1/* HTTP endpoint (chat/completions, responses, embeddings, decisions, models, ...). Not supported: WebSocket / Realtime. - Errors with OpenAI's JSON shape come from OpenAI; a 401/404 saying "Bearer" or "/v1/*" comes from this proxy. - Full reference: https://api.aiinflow.com/llms.txt
Troubleshooting常见问题
| You see现象 | Meaning and fix原因与处理 |
|---|---|
404 Use /v1/* for API requests | Base URL is missing /v1, or the client added a second /v1.Base URL 少了 /v1,或客户端又拼了一次 /v1。 |
401 … Authorization: Bearer <key> | No key was sent. A 401 in OpenAI's own wording means the key itself is wrong.没有带 Key。若 401 是 OpenAI 的原文提示,说明 Key 本身不对。 |
403 unsupported_country_region_territory | From OpenAI: the caller's location is not a supported region.来自 OpenAI:调用者所在地不在支持地区。 |
| Streaming arrives all at once流式结果一次性到达 | Something between you and this endpoint buffers responses. With curl, add -N.中间某层在缓冲响应;curl 请加 -N。 |
501 unsupported_transport | WebSocket / Realtime was attempted. Use the HTTP endpoints.尝试了 WebSocket / Realtime,请改用 HTTP 接口。 |
Good to know须知
- Requests are billed to the API key you send. This endpoint stores no keys.费用记在你发送的 API Key 上,本服务不保存任何 Key。
- Rill keeps no response cache and no request or body logs. The host's own infrastructure may log traffic; use an endpoint you trust.Rill 不缓存响应,不记录请求和正文;托管平台可能有自己的日志,请使用你信任的地址。
- Rill does not change who may use the API. Follow OpenAI's usage policies.Rill 不改变 API 的使用资格,请遵守 OpenAI 的使用政策。
- Health check:
/health(checks this proxy, not OpenAI).健康检查:/health(检查本代理,不代表 OpenAI 状态)。