API Documentation
Embeddings API
Image API
Audio Batch API
Accounts
Deployments
Models
Supervised Fine Tuning Jobs
Datasets
LLM API
Create Chat Completion
Creates a model response for the given chat conversation.
POST
/
chat
/
completions
curl --request POST \
--url https://api.fireworks.ai/inference/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "accounts/fireworks/models/llama-v3p1-8b-instruct",
"messages": [
{
"role": "system",
"content": "<string>",
"name": "<string>"
}
],
"tools": [
{
"type": "function",
"function": {
"description": "<string>",
"name": "<string>",
"parameters": {
"type": "object",
"required": [
"<string>"
],
"properties": {}
}
}
}
],
"max_tokens": 2000,
"prompt_truncate_len": 1500,
"temperature": 1,
"top_p": 1,
"top_k": 50,
"frequency_penalty": 0,
"presence_penalty": 0,
"repetition_penalty": 1,
"reasoning_effort": "low",
"mirostat_lr": 0.1,
"mirostat_target": 1.5,
"n": 1,
"ignore_eos": false,
"stop": "<string>",
"response_format": null,
"stream": false,
"context_length_exceeded_behavior": "truncate",
"user": "<string>"
}'
{
"id": "<string>",
"object": "<string>",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "system",
"content": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Response
200 - application/json
OK
The response is of type object
.
Was this page helpful?
curl --request POST \
--url https://api.fireworks.ai/inference/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "accounts/fireworks/models/llama-v3p1-8b-instruct",
"messages": [
{
"role": "system",
"content": "<string>",
"name": "<string>"
}
],
"tools": [
{
"type": "function",
"function": {
"description": "<string>",
"name": "<string>",
"parameters": {
"type": "object",
"required": [
"<string>"
],
"properties": {}
}
}
}
],
"max_tokens": 2000,
"prompt_truncate_len": 1500,
"temperature": 1,
"top_p": 1,
"top_k": 50,
"frequency_penalty": 0,
"presence_penalty": 0,
"repetition_penalty": 1,
"reasoning_effort": "low",
"mirostat_lr": 0.1,
"mirostat_target": 1.5,
"n": 1,
"ignore_eos": false,
"stop": "<string>",
"response_format": null,
"stream": false,
"context_length_exceeded_behavior": "truncate",
"user": "<string>"
}'
{
"id": "<string>",
"object": "<string>",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "system",
"content": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}
Assistant
Responses are generated using AI and may contain mistakes.