API Reference
Send structured conversation messages to Cortiqa models. This endpoint is natively targeted by our TypeScript, Java, C#, and Swift SDKs.
https://api.cortiqa.co/api/v1/messages| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID, e.g. openai/gpt-oss-120b. |
messages | array | Yes | Array of message objects: { role: "user" | "assistant", content: string }. |
max_tokens | integer | No | Maximum output tokens to generate (default: 1024, max 4096). |
system | string | No | Top-level system instruction prompt. |
tools | array | No | Definitions of callable functions. |
stream | boolean | No | Stream tokens via SSE if true. |
{
"id": "msg_01JHE9Z874M9",
"type": "message",
"role": "assistant",
"model": "openai/gpt-oss-120b",
"content": "A goroutine is a lightweight thread of execution managed by the Go runtime.",
"stop_reason": "end_turn",
"usage": {
"input_tokens": 16,
"output_tokens": 22,
"total_tokens": 38
}
}import Cortiqa from "@cortiqa/sdk";
const client = new Cortiqa();
const message = await client.messages.create({
model: "openai/gpt-oss-120b",
max_tokens: 1024,
messages: [{ role: "user", content: "Explain goroutines." }],
});
console.log(message.content);import co.cortiqa.sdk.CortiqaClient;
import co.cortiqa.sdk.models.*;
CortiqaClient client = CortiqaClient.fromEnv();
ChatCompletionResponse response = client.messages().create(
ChatCompletionRequest.builder()
.model("openai/gpt-oss-120b")
.addMessage(ChatMessage.user("Explain goroutines."))
.build()
);
System.out.println(response.getContent());