/v1/models
Returns the enabled model IDs for the current environment in an OpenAI-style list envelope.
API CONTRACT
Tsubasa implements model discovery and OpenAI-compatible Chat Completions. Use a Tsubasa key and a model ID returned by the current catalog.
Returns the enabled model IDs for the current environment in an OpenAI-style list envelope.
Accepts multi-message chat requests and returns either one JSON completion or server-sent event chunks.
CLIENT EXAMPLES
The JavaScript example is covered by the repository’s official client test. Python follows the official client’s custom base URL interface and remains Experimental until its own automated contract test is added.
import OpenAI from "openai"
const client = new OpenAI({
apiKey: process.env.TSUBASA_API_KEY,
baseURL: "https://api.tsubasa.sh/v1",
})
const stream = await client.chat.completions.create({
model: "tsubasa-medium",
messages: [
{ role: "system", content: "Be precise and concise." },
{ role: "user", content: "Review this repository and propose a patch." },
],
max_tokens: 512,
temperature: 0.7,
stream: true,
})
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "")
}import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["TSUBASA_API_KEY"],
base_url="https://api.tsubasa.sh/v1",
)
stream = client.chat.completions.create(
model="tsubasa-medium",
messages=[
{"role": "system", "content": "Be precise and concise."},
{"role": "user", "content": "Review this repository."},
],
max_tokens=512,
temperature=0.7,
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")curl https://api.tsubasa.sh/v1/chat/completions \
-H "Authorization: Bearer $TSUBASA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tsubasa-medium",
"messages": [{"role": "user", "content": "Explain this code."}],
"max_tokens": 512,
"temperature": 0.7,
"stream": false
}'Model capability labels are separate from transport support. A working Chat Completions endpoint does not prove tool calling, structured output, vision, or coding quality; check the canonical model definition before relying on those behaviors.