LLM Endpoints
Call the LLM configurations available to you in Bunyan through an OpenAI-compatible API. Manage your configurations and API keys in Bunyan.
Base URL and Authentication
Use this production base URL:
https://inference-v2.bunyan.ai/v1/Create an API key in Bunyan, then send it with each request:
Authorization: Bearer YOUR_API_KEYFor an OpenAI-compatible client, set its base URL to the URL above and its API key to your Bunyan key.
Chat Completions
POST /chat/completions
Generate a response from a list of messages. Replace YOUR_API_KEY with your key and use a model configuration available to you.
curl -X POST https://inference-v2.bunyan.ai/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "global/glm-5.3-flash",
"messages": [
{
"role": "user",
"content": "Hello!"
}
],
"temperature": 0.7
}'Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Name of the LLM configuration to call, such as global/glm-5.3-flash. |
messages | array | Yes | Conversation messages, each with a role and content. |
temperature | number | No | Sampling setting, where supported by the selected model. |
For a conversation, include earlier user and assistant messages in messages along with the new question. Supported optional parameters and limits depend on the selected model.
Response
Read the generated text from choices[0].message.content. For example, a response can contain:
{
"choices": [
{
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
]
}This is a response excerpt; generated text and additional response fields vary.
Troubleshooting
| Problem | What to check |
|---|---|
| Authentication fails | Use your Bunyan API key, confirm that it is active and unexpired, and send it in the Authorization header shown above. |
| The model is unavailable | Check the model name and your access to its configuration in Bunyan. |
| A parameter is rejected | Check whether the selected model supports that parameter and value. |
| A request is limited | Review the error message, key budget, and available usage allowance in Bunyan. Follow Retry-After when supplied. |
For document parsing, summarization, extraction, and agentic document tasks, use Document Intelligence.