Model API
Use organization-owned model keys with OpenAI-compatible text and function-call requests.
Use the Model API to add text generation and function calling to your application with an OpenAI-compatible client.
Create a key
An organization administrator can create and revoke Model API keys in the organization's API settings. Use a dedicated Model API key, separate from your Voice or MCP credentials. Keep the key on your backend. Contact Chatbyte support if you need help enabling access.
Make your first request
Use https://api.chatbyte.ai/v1 as the OpenAI SDK base URL. List the models available to your organization, then choose one for your request.
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: '<organization-model-api-key>',
baseURL: 'https://api.chatbyte.ai/v1',
maxRetries: 0,
});
const models = await client.models.list();
const availableModel = models.data[0];
if (!availableModel) throw new Error('No model is available.');
const reply = await client.chat.completions.create({
model: availableModel.id,
messages: [{ role: 'user', content: 'Summarize this appointment note.' }],
max_completion_tokens: 256,
store: false,
});Add it to your application
The API supports text, streaming, and function calling through Chat Completions and Responses. For function calling, your application executes the requested function and sends its result in a new request.
Requests are stateless: include the conversation context your application needs and use store: false. Check the API reference for supported fields, streaming examples, and function-call formats before adapting an existing OpenAI integration.
Handle errors and retries
The example disables automatic retries so your application can handle each result explicitly. Follow the API reference for error codes and idempotency rules before enabling retries, particularly when a connection ends before you receive the result. Respect Retry-After when it is returned.
The OpenAPI document provides the full request and response schemas for client generation.