cURL
curl --request POST \ --url https://api.tkhub.ai/v1/v1/completions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "model": "<string>", "prompt": "<string>", "max_tokens": 123, "temperature": 123, "top_p": 123, "n": 123, "stream": true, "stop": "<string>", "suffix": "<string>", "echo": true } '
{ "id": "<string>", "object": "text_completion", "created": 123, "model": "<string>", "choices": [ { "text": "<string>", "index": 123, "finish_reason": "<string>" } ], "usage": { "prompt_tokens": 123, "completion_tokens": 123, "total_tokens": 123, "prompt_tokens_details": { "cached_tokens": 123, "text_tokens": 123, "audio_tokens": 123, "image_tokens": 123 }, "completion_tokens_details": { "text_tokens": 123, "audio_tokens": 123, "reasoning_tokens": 123 } } }
基于给定提示创建文本补全
使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx
Authorization: Bearer sk-xxxxxx
成功创建响应
"text_completion"
Show child attributes
Was this page helpful?