OpenAI's flagship multimodal model. Industry-leading performance in reasoning, coding, and creative tasks with native vision capabilities and structured output support.
| Token Type | Credits | USD Equivalent |
|---|---|---|
| Input Tokens | 2,500 | $2.50 |
| Output Tokens | 10,000 | $10.00 |
| Cached Tokens | 1,250 | $1.25 |
* 1 credit โ $0.001 (actual charges may vary based on usage)
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"model": "gpt-4o",
"input": {
"model": "gpt-4o",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Explain quantum computing in simple terms."
}
],
"temperature": 0.7,
"max_tokens": 1000
}
}'| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
messages | array | Yes | - | Array of message objects with role and content |
model | string | Yes | gpt-4o | Model identifier |
temperature | float | No | 1.0 | Sampling temperature (0-2). Lower = more focused, higher = more creative |
max_tokens | integer | No | 4096 | Maximum tokens in response (up to 16384) |
stream | boolean | No | false | Enable Server-Sent Events streaming |
response_format | object | No | - | Format of response: { type: 'json_object' } for JSON mode |
tools | array | No | - | List of tools (functions) the model can call |
top_p | float | No | 1.0 | Nucleus sampling threshold (0-1) |
Simple conversation with the model
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"model": "gpt-4o",
"input": {
"model": "gpt-4o",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Explain quantum computing in simple terms."
}
],
"temperature": 0.7,
"max_tokens": 1000
}
}'Generate Python code with explanation
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"model": "gpt-4o",
"input": {
"model": "gpt-4o",
"messages": [
{
"role": "system",
"content": "You are an expert Python developer. Write clean, well-documented code."
},
{
"role": "user",
"content": "Write a Python class for a binary search tree with insert, search, and delete methods."
}
],
"temperature": 0.3,
"max_tokens": 2000
}
}'Get structured JSON output
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"model": "gpt-4o",
"input": {
"model": "gpt-4o",
"messages": [
{
"role": "system",
"content": "You are a data extraction assistant. Always respond with valid JSON."
},
{
"role": "user",
"content": "Extract the following info from this text: 'John Smith, 35 years old, software engineer at Google, living in San Francisco'. Return as JSON with fields: name, age, job, company, city"
}
],
"response_format": {
"type": "json_object"
},
"max_tokens": 500
}
}'Analyze images with GPT-4o
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"model": "gpt-4o",
"input": {
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What's in this image? Describe it in detail."
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/image.jpg"
}
}
]
}
],
"max_tokens": 1000
}
}'Use tools/functions with the model
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"model": "gpt-4o",
"input": {
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "What's the weather like in Seoul today?"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City name"
},
"unit": {
"type": "string",
"enum": [
"celsius",
"fahrenheit"
]
}
},
"required": [
"location"
]
}
}
}
]
}
}'POST /llm/openai/v1/chat/completions