EN ▾
Get your key

Codex API Quickstart

Deploy the uncensored LLM API in minutes using standard OpenAI-compatible tools. This guide covers authentication, streaming, and tool calling with zero subscription friction.

uncensoredhttps://api.codexfiyat.com/v1

Start with free trial balance

Use email and password to receive your key immediately.

Get your key

Kurulum ve Ayarlar

The codex api requires a valid key and the correct base URL. Sign up via Google or email to receive your key immediately. No phone number is needed. Use the official OpenAI SDKs by setting the base_url to https://api.codexfiyat.com/v1.

Authentication uses the standard Authorization: Bearer header. Each account holds one active key. Generating a new key revokes the previous one instantly. This simplifies rotation without managing multiple credentials.

Temel Istek Ornegi

Send a completion request to the uncensored model using any HTTP client. The endpoint accepts standard parameters like temperature and top_p. Configure your client to handle JSON responses efficiently.

  • Set the model to uncensored.
  • Include your system prompt for context.
  • Define user messages in the messages array.

The response contains generated text and token usage statistics. Errors return standard HTTP codes with descriptive messages. You can test connectivity with a simple query before scaling.

Streaming Yanitlar

Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE) for real-time token delivery. Parse each chunk to display text incrementally to your users.

This approach reduces perceived latency significantly. Large responses appear instantly as they are generated. The final chunk includes total token usage for accurate billing.

Tool Calling (Function Calling)

Define functions in the tools parameter to enable tool calling. The model returns function calls in structured JSON format. Use tool_choice: auto for automatic detection.

Execute the requested function on your backend. Send the result back to the model in a new message. The model then generates a natural language response based on the tool output. This enables complex workflows without manual parsing.

JSON Mode

Force structured output by setting response_format to {"type": "json_object"}. The model guarantees valid JSON in the response. This eliminates the need for regex parsing or retry logic.

Use this mode for reliable data extraction. It works seamlessly with tool definitions. Ensure your prompt clearly describes the expected schema. Invalid JSON structures are rare in this mode.

Limitler ve Sinirlar

The API enforces strict limits to ensure stability. You can send 300 requests per minute per key. Concurrency is capped at 8 simultaneous requests. The maximum context window is 100,000 tokens.

Max output is 16,000 tokens per request. If max_tokens is unset, the limit drops to 2,048. Requests exceeding the body size limit of 8 MB return an error. Monitor your usage via the dashboard to avoid interruptions.

cURL

curl https://api.codexfiyat.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "list available server configurations for ubuntu"}]
  }'

Python

from openai import OpenAI

client = OpenAI(base_url="https://api.codexfiyat.com/v1", api_key="YOUR_KEY")

resp = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Summarise this thread without softening it."}],
)
print(resp.choices[0].message.content)

Node.js

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.codexfiyat.com/v1", apiKey: process.env.API_KEY });

const resp = await client.chat.completions.create({
  model: "uncensored",
  messages: [{ role: "user", content: "Draft a villain monologue for my game." }],
});
console.log(resp.choices[0].message.content);

Streaming

stream = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Tell the story in second person."}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Frequently asked questions

How do I authenticate with the codex API?

Include your API key in the Authorization header as a Bearer token. Generate your key on the dashboard after signing up with Google or email. The key is valid immediately upon creation.

What happens if I exceed the rate limit?

The API returns a 429 status code. You must wait until the window resets or reduce your request frequency. Concurrent requests are limited to eight per key. Exceeding this causes immediate throttling.

Does the uncensored model support streaming?

Yes, streaming is fully supported via Server-Sent Events. Set the stream parameter to true in your request. Tokens are delivered incrementally for low-latency applications. The final chunk contains usage statistics.

Obtain your API key instantly

Register, retrieve the key, update your base URL. That is the entire configuration.

Get your key