o1-mini
Model Overview
A cost-efficient reasoning model optimized for STEM tasks (science, technology, engineering, and math), particularly excelling in mathematics and coding. It offers advanced reasoning capabilities at a fraction of the cost of its larger counterpart, o1-preview.
How to Make a Call
API Schema
Creates a chat completion using a language model, allowing interactive conversation by predicting the next response based on the given chat history. This is useful for AI-driven dialogue systems and virtual assistants.
An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.
512
The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API.
512
If set to True, the model response data will be streamed to the client as it is generated using server-sent events.
false
How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs.
This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
POST /v1/chat/completions HTTP/1.1
Host: api.aimlapi.com
Authorization: Bearer <YOUR_AIMLAPI_KEY>
Content-Type: application/json
Accept: */*
Content-Length: 194
{
"model": "o1-mini",
"messages": [
{
"role": "user",
"content": "text",
"name": "text"
}
],
"max_completion_tokens": 512,
"max_tokens": 512,
"stream": false,
"stream_options": {
"include_usage": true
},
"n": 1,
"seed": 1
}
No content
Code Example
import requests
response = requests.post(
"https://api.aimlapi.com/v1/chat/completions",
headers={
"Content-Type":"application/json",
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
"Authorization":"Bearer <YOUR_AIMLAPI_KEY>",
"Content-Type":"application/json"
},
json={
"model":"o1-mini",
"messages":[
{
"role":"user",
# Insert your question for the model here, instead of Hello:
"content":"Hello"
}
]
}
)
data = response.json()
print(data)
Last updated
Was this helpful?