OpenAI API
FUNCD provides OpenAI-compatible Chat Completions and Responses APIs at:
text
https://api.funcd.org/v1Chat Completions
bash
curl 'https://api.funcd.org/v1/chat/completions' \
-H "Authorization: Bearer $FUNCD_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "tokener-gpt-5-6-luna",
"messages": [{"role": "user", "content": "Hello"}],
"max_tokens": 128
}'Python SDK
python
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["FUNCD_API_KEY"],
base_url="https://api.funcd.org/v1",
)
response = client.chat.completions.create(
model="tokener-gpt-5-6-luna",
messages=[{"role": "user", "content": "Hello"}],
max_tokens=128,
)
print(response.choices[0].message.content)JavaScript SDK
javascript
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.FUNCD_API_KEY,
baseURL: "https://api.funcd.org/v1",
});
const response = await client.chat.completions.create({
model: "tokener-gpt-5-6-luna",
messages: [{ role: "user", content: "Hello" }],
max_tokens: 128,
});
console.log(response.choices[0].message.content);Responses API
Use Responses for Codex CLI, function tools, and native streaming events.
python
response = client.responses.create(
model="tokener-gpt-5-6-luna",
input="Reply only with OK",
store=False,
)
print(response.output_text)Current scope
Standard responses, streaming, and local function tools are supported. Upstream session storage, previous_response_id, background tasks, and hosted web search are not currently exposed.
Streaming
Add the following field to the request:
json
{ "stream": true }Read the stream through its final event. Missing or inconsistent usage is moved to billing review and is not treated as free usage.