Text Completion
Text completions are used for single-turn tasks like code generation or simple text prompts.
const response = await client.completions.create({ model: 'gpt-3.5-turbo-instruct', prompt: 'Once upon a time', max_tokens: 50,});
console.log(response.choices[0].text);response = client.completions.create( model="gpt-3.5-turbo-instruct", prompt="Once upon a time", max_tokens=50)
print(response.choices[0].text)Raw HTTP API
Section titled “Raw HTTP API”curl -X POST https://api.exnest.app/v1/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "openai:gpt-4.1-mini", "prompt": "siapa kamu?", "temperature": 0.7, "maxTokens": 100, "stream": false, "exnest_metadata": false, "timeout": 100000 }'