Create a text completion
curl --request POST \
--url https://api.tera.gw/v1/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "Qwen/Qwen2.5-7B-Instruct",
"prompt": "<string>",
"max_tokens": 64,
"temperature": 123,
"top_p": 123,
"top_k": 123,
"stop": "<string>",
"seed": 123,
"stream": false
}
'{
"id": "<string>",
"object": "text_completion",
"created": 123,
"model": "<string>",
"choices": [
{
"text": "<string>",
"index": 123
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}API Reference
Text completions
OpenAI-compatible legacy completions endpoint. Prefer chat completions for new code.
POST
/
v1
/
completions
Create a text completion
curl --request POST \
--url https://api.tera.gw/v1/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "Qwen/Qwen2.5-7B-Instruct",
"prompt": "<string>",
"max_tokens": 64,
"temperature": 123,
"top_p": 123,
"top_k": 123,
"stop": "<string>",
"seed": 123,
"stream": false
}
'{
"id": "<string>",
"object": "text_completion",
"created": 123,
"model": "<string>",
"choices": [
{
"text": "<string>",
"index": 123
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
⌘I