GET/api/v1/models
List available models with runtime metadata and capability flags.
OpenAI-compatible API references and integration guides for common AI developer tools.
GET/api/v1/models
List available models with runtime metadata and capability flags.
POST/api/v1/chat/completions
OpenAI-compatible chat completion endpoint with tools, vision, and streaming.
POST/api/v1/completions
OpenAI legacy completion endpoint for prompt-based generation.
POST/api/v1/tokenize
Token estimator endpoint for prompt sizing and quota planning.
List models
curl -s https://theaibazaar.com/api/v1/models \ -H "Authorization: Bearer <YOUR_API_KEY>"
Chat completion
curl -s https://theaibazaar.com/api/v1/chat/completions \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5-3-codex",
"messages": [
{"role": "system", "content": "You are a helpful coding assistant."},
{"role": "user", "content": "Write a TypeScript debounce helper."}
],
"stream": false,
"temperature": 0.2
}'Text completion
curl -s https://theaibazaar.com/api/v1/completions \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5-3-codex",
"prompt": "Summarize this PR in bullet points:",
"max_tokens": 160
}'Tokenize
curl -s https://theaibazaar.com/api/v1/tokenize \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-5-3-codex", "input": "Explain pgvector indexing options."}'JavaScript
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.AI_BAZAAR_API_KEY,
baseURL: "https://theaibazaar.com/api/v1",
});
const result = await client.chat.completions.create({
model: "gpt-5-3-codex",
messages: [{ role: "user", content: "Build a search API design" }],
});
console.log(result.choices[0]?.message);Python
from openai import OpenAI
client = OpenAI(
api_key=os.getenv("AI_BAZAAR_API_KEY"),
base_url="https://theaibazaar.com/api/v1",
)
res = client.chat.completions.create(
model="gpt-5-3-codex",
messages=[{"role": "user", "content": "Outline Redis queue strategy"}],
)
print(res.choices[0].message)