Text Generation API
Generate text using the chat completion endpoint. Supports GPT-4o, Claude, Gemini and more.
Endpoint
The chat completion endpoint:
http
POST https://api.tk-novalink.com/v1/chat/completionsParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model name, e.g. gpt-4o |
| messages | array | Yes | Array of chat messages |
| temperature | number | No | Sampling temperature, 0-2 |
| max_tokens | integer | No | Max tokens to generate |
| stream | boolean | No | Whether to stream the response |
Request Example
bash
curl -X POST "https://api.tk-novalink.com/v1/chat/completions" \
-H "Authorization: Bearer sk-xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello!"}]
}'Streaming Response
Set stream=true to enable streaming responses:
bash
curl -X POST "https://api.tk-novalink.com/v1/chat/completions" \
-H "Authorization: Bearer sk-xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello!"}],
"stream": true
}'Supported Models
Commonly used text generation models:
| Model | Description | Context Window |
|---|---|---|
| gpt-4o | OpenAI flagship model | 128K |
| gpt-4o-mini | Lightweight model | 128K |
| claude-sonnet-4 | Anthropic coding workhorse | 200K |
| gemini-2.5-pro | Google multimodal | 1M |
| deepseek-v3 | High cost-performance | 64K |
Next
Embeddings API