API reference

Developer documentation

TKNMart exposes OpenAI-compatible routes while metering usage against customer wallets and your configured supplier account.

List models

curl https://tknmart.com/v1/models \
  -H "Authorization: Bearer tm_live_..."

Chat completions

curl https://tknmart.com/v1/chat/completions \
  -H "Authorization: Bearer tm_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tm/openai/gpt-5.4-mini",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Responses API

curl https://tknmart.com/v1/responses \
  -H "Authorization: Bearer tm_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tm/openai/gpt-5.6",
    "input": "Explain this repository in one paragraph."
  }'

Image generation

curl https://tknmart.com/v1/images/generations \
  -H "Authorization: Bearer tm_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tm/openai/gpt-image-2",
    "prompt": "A clean product mockup of a TKNMart API dashboard",
    "size": "1024x1024",
    "quality": "low"
  }'

Gemini text to speech

curl https://tknmart.com/v1/audio/speech \
  -H "Authorization: Bearer tm_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemini-2.5-flash-tts",
    "input": "Welcome to TKNMart.",
    "voice": "Kore",
    "response_format": "wav"
  }' --output speech.wav

Codex CLI configuration

Codex uses TKNMart's Responses API with your own TKNMart secret key.

~/.codex/config.toml

model = "openai/gpt-5.4-mini"
model_provider = "tknmart"

[model_providers.tknmart]
name = "TKNMart"
base_url = "https://tknmart.com/v1"
env_key = "TKNMART_API_KEY"
wire_api = "responses"

Use openai/<model> in Codex, such as openai/gpt-5.6-luna. TKNMart routes it to the matching tm/openai/<model> catalog entry.

Set the key and start Codex

# PowerShell
$env:TKNMART_API_KEY="tm_live_..."
codex

# Linux / macOS
export TKNMART_API_KEY="tm_live_..."
codex

Replace the sample key in an example above with your TKNMart API key and choose a live model.