POST /v1/messages
Request
- Base URLhttps://api.ttapi.io
- AuthAPI key in header x-api-key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"messages": [
{
"role": "user",
"content": "Hello!"
}
],
"model": "claude-sonnet-4-5"
}Response
Successful response
Example response
{
"id": "msg_018zZJf8ZJf8ZJf8ZJf8ZJf8ZJf8",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": " Hello! My name is Claude."
}
],
"model": "claude-2.0",
"stop_reason": "stop_sequence",
"usage": {
"input_tokens": 15,
"output_tokens": 22
}
}Changes
No recorded changes to this operation across all 1 revision of this API.