Docs

OpenAI-compatible API references and integration guides for common AI developer tools.

Endpoints

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.

cURL examples

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."}'

SDK quickstarts

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)

Integrations

Cursor

  1. Open Settings > Models and add custom OpenAI-compatible provider.
  2. Set Base URL to https://theaibazaar.com/api/v1.
  3. Paste your AI Bazaar API key.
  4. Select an AI Bazaar model id (for example, gpt-5-3-codex).

Cline

  1. Choose OpenAI-compatible endpoint mode in provider settings.
  2. Set endpoint to https://theaibazaar.com/api/v1/chat/completions.
  3. Attach your API key and preferred model id.

Roo Code

  1. Configure custom OpenAI API base URL.
  2. Set API key and default model.
  3. Enable streaming for best interaction latency.

Aider

  1. Export OPENAI_API_BASE=https://theaibazaar.com/api/v1.
  2. Export OPENAI_API_KEY=<YOUR_AI_BAZAAR_KEY>.
  3. Run aider with --model <model-id>.

OpenWebUI

  1. Add a new OpenAI endpoint connection.
  2. Set API URL to https://theaibazaar.com/api/v1.
  3. Save key and choose model mapping.

LangChain

  1. Use ChatOpenAI with base_url set to AI Bazaar endpoint.
  2. Pass api_key from environment.
  3. Select model id and optional tools schema.

LlamaIndex

  1. Use OpenAI-compatible LLM class with base URL override.
  2. Set model and API key.
  3. Route retrieval answers via chat completions.
⌘K
AI Bazaar