Responses and chat
Streaming text, structured JSON, multimodal input, persistent response chains, and familiar chat completions.
POST /responsesBuild chat, agents, live research, image workflows, multilingual voice, transcription, embeddings, and safety into your applications—through secure Kitano credentials and cost-aware KTN models.
curl https://kitanoai.com/api/v1/responses \ -H "Authorization: Bearer $KITANO_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: report-2026-07-25" \ -d '{ "model": "KTN-5.6 Terra", "input": "Research sustainable tourism trends", "tools": [{"type": "web_search"}], "background": true }'
A coherent platform surface with Kitano branding, account-aware model access, protective credit checks, and consistent errors across every endpoint.
Streaming text, structured JSON, multimodal input, persistent response chains, and familiar chat completions.
POST /responsesGive models current web access and return source citations and confirmed activity with the answer.
tools: web_searchRun calculation and analysis work in a temporary interpreter workspace when the task needs it.
tools: code_interpreterCreate high-quality visuals or edit uploaded assets, with URL and base64 delivery options.
/images/generations · /editsNatural multilingual speech in multiple formats and secure transcription for common audio types.
/audio/speech · /transcriptionsPower semantic search and classify user-generated text or image content before it reaches production.
/embeddings · /moderationsAll authenticated requests use a secret ktn_… key. Keep it on your backend and send it as a Bearer token.
Only capabilities included in a key’s scopes are accessible. GET /capabilities tells your application what is enabled.
/capabilitiesDiscover features, voices, and limits/modelsList account-enabled KTN models/usageInspect usage, latency, status, and credits/responsesCreate streaming, stored, or background responses/chat/completionsUse the compatible chat-completions contract/images/generationsGenerate production images/images/editsEdit uploaded images/audio/speechCreate natural speech audio/audio/transcriptionsTranscribe multilingual audio/embeddingsCreate semantic vectors/moderationsClassify content safetyUse any secure server-side HTTP client with Kitano’s base URL and KTN model names. Keep the API key in a server environment variable.
import os
import requests
response = requests.post(
"https://kitanoai.com/api/v1/responses",
headers={
"Authorization": f"Bearer {os.environ['KITANO_API_KEY']}",
"Content-Type": "application/json",
},
json={
"model": "KTN-5.6 Terra",
"input": "Give me three launch ideas",
},
timeout=120,
)
response.raise_for_status()
print(response.json()["output_text"])
const response = await fetch("https://kitanoai.com/api/v1/responses", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KITANO_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "KTN-5.6 Terra",
input: "Give me three launch ideas"
})
});
if (!response.ok) throw new Error(`Kitano request failed: ${response.status}`);
console.log((await response.json()).output_text);
$response = Http::withToken(env('KITANO_API_KEY'))
->post('https://kitanoai.com/api/v1/responses', [
'model' => 'KTN-5.6 Terra',
'input' => 'Give me three launch ideas',
]);
echo $response->json('output_text');
Send an Idempotency-Key on mutations so a network retry cannot accidentally create duplicate work. For long tasks, set background: true, save the returned response ID, then poll GET /responses/{id}. Stored synchronous responses can be continued with previous_response_id.
Secret keys are stored as one-way hashes, can be restricted by scope, IP range, and expiration, and can be revoked independently. Every paid capability performs a credit preflight and records usage. Never place a key in browser JavaScript, a mobile binary, or a public repository.
Errors use a consistent object with message, type, param, and code. Respect HTTP 429 and Retry-After, and use exponential backoff with jitter for temporary 5xx failures.