Open API key management · Beta credit policy
1. Set your API key
export SUBFOR_API_KEY="your-own-api-key"
export SUBFOR_BASE_URL="https://token.subfor.me/v1"2. List available models
curl "$SUBFOR_BASE_URL/models" \
-H "Authorization: Bearer $SUBFOR_API_KEY"3. Make a chat request
curl "$SUBFOR_BASE_URL/chat/completions" \
-H "Authorization: Bearer $SUBFOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemini-3.5-flash-lite","messages":[{"role":"user","content":"Hello!"}],"max_tokens":128}'4. Stream output and usage
curl -N "$SUBFOR_BASE_URL/chat/completions" \
-H "Authorization: Bearer $SUBFOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gemini-3.5-flash-lite","messages":[{"role":"user","content":"Count from 1 to 10."}],"max_tokens":128,"stream":true,"stream_options":{"include_usage":true}}'Text arrives in SSE data events; usage normally arrives near the end. Heartbeats are not output tokens. Cancellation can still incur usage for work already performed.
5. Python SDK
pip install openai
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["SUBFOR_API_KEY"],
base_url="https://token.subfor.me/v1",
)
response = client.chat.completions.create(
model="gemini-3.5-flash-lite",
messages=[{"role": "user", "content": "Hello!"}],
max_tokens=128,
)
print(response.choices[0].message.content)Tool calls and client compatibility
Gemini Flash Lite Chat Completions tool selection and tool-result continuation have been verified. Preserve tool_call_id and return the result with role: "tool".
Select an OpenAI-compatible provider in your client and enter the base URL above. Full client, Responses and WebSocket compatibility is not promised. A dedicated Codex++ integration will follow separate validation.
Troubleshooting
- 401: Check for an invalid, expired or revoked key.
- 403 / insufficient quota: Check account balance, key budget and model access. New accounts need an allocation from their inviter.
- 429: Reduce concurrency, back off and respect Retry-After.
- 5xx / timeout: Check the performance page. Do not automatically retry tools or payment actions that may already have executed.