Demonstrates chat usage across languages.
cURL#
bash
curl -X POST "$API_BASE/v1/chat" \
-H 'content-type: application/json' \
-H "authorization: Bearer $API_KEY" \
-d '{"persona":"zen_master","input":{"text":"Hello"}}'
JavaScript#
javascript
const res = await fetch(`${API_BASE}/v1/chat`, {
method: 'POST',
headers: {
'content-type': 'application/json',
authorization: `Bearer ${API_KEY}`,
},
body: JSON.stringify({ persona: 'zen_master', input: { text: 'Hello' } }),
});
Kotlin#
kotlin
// See docs/code-samples/kotlin/Chat.kt for a full example
Swift#
swift
// See docs/code-samples/swift/Chat.swift for a full example