Codzen

Quickstart

Get started with Codzen - a unified API for hundreds of AI models

Codzen provides a unified API that gives you access to hundreds of AI models through a single endpoint. Get started with just a few lines of code using your preferred SDK or framework.

Using the Codzen API directly

import json
import httpx  # Make sure to install httpx first

response = httpx.post(
    "https://codzen.ai/v1/chat/completions",
    json={
        "model": "gpt-5-mini",
        "messages": [
            {
                "role": "user",
                "content": "What is the meaning of life?",
            },
        ],
    },
    headers={
        "Authorization": f"Bearer <CODZEN_API_KEY>",
        "Content-Type": "application/json",
    },
    timeout=30.0,
)
fetch('https://codzen.ai/v1/chat/completions', {
  method: 'POST',
  headers: {
    Authorization: `Bearer <CODZEN_API_KEY>`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'gpt-5-mini',
    messages: [
      {
        role: 'user',
        content: 'What is the meaning of life?',
      },
    ],
  }),
});
curl https://codzen.ai/v1/chat/completions \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <CODZEN_API_KEY>" \
  -d '{
    "model": "gpt-5-mini",
    "messages": [
      {
        "role": "user",
        "content": "What is the meaning of life?"
      }
    ]
  }'

Using the OpenAI SDK

import OpenAI from 'openai';

const openai = new OpenAI({
  baseURL: 'https://codzen.ai/v1',
  apiKey: '<CODZEN_API_KEY>'
});

async function main() {
  const completion = await openai.chat.completions.create({
    model: 'gpt-5-mini',
    messages: [
      {
        role: 'user',
        content: 'What is the meaning of life?',
      },
    ],
  });

  console.log(completion.choices[0].message);
}

main();
from openai import OpenAI

client = OpenAI(
  base_url="https://codzen.ai/v1",
  api_key="<CODZEN_API_KEY>"
)

completion = client.chat.completions.create(
  model="gpt-5-mini",
  messages=[
    {
      "role": "user",
      "content": "What is the meaning of life?",
    },
  ],
)

print(completion.choices[0].message.content)

Using third-party SDKs

For information about using third-party SDKs and frameworks with Codzen, please see the frameworks documentation.

On this page