Getting Started
Spaces Guide
Tools Guide
Developer Guide
API REFERENCE
- Spaces
- Data
- Chat
- Assistants
- Documents
PULZE ACADEMY
Chat
Chat Completions
Perform a Chat Completion request.
POST
/
v1
/
chat
/
completions
curl --request POST \
--url https://api.pulze.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "<string>",
"max_tokens": 123,
"temperature": 0.5,
"top_p": 123,
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {
"type": "object",
"properties": {},
"required": [
"<string>"
]
}
}
}
],
"tool_choice": "none",
"n": 2,
"stream": true,
"logprobs": 2,
"stop": "<string>",
"presence_penalty": 0,
"frequency_penalty": 0,
"best_of": 2,
"logit_bias": {},
"response_format": {
"type": "text"
},
"messages": [
{
"role": "user",
"content": "<string>",
"tool_calls": [
{
"function": {
"arguments": "<string>",
"name": "<string>"
},
"id": "<string>",
"type": "function"
}
]
}
],
"plugins": [
"<string>"
]
}'
{
"choices": [
{
"index": 123,
"finish_reason": "<string>",
"message": {
"role": "user",
"content": "<string>",
"tool_calls": [
{
"function": {
"arguments": "<string>",
"name": "<string>"
},
"id": "<string>",
"type": "function"
}
]
}
}
],
"created": 0,
"metadata": {
"app_id": "<string>",
"model": {
"model": "<string>",
"provider": "<string>",
"owner": "<string>",
"namespace": "<string>",
"at": "<string>"
},
"costs": {
"total_tokens": 123,
"prompt_tokens": 123,
"completion_tokens": 123
},
"cost_savings": {
"total_tokens": 123,
"prompt_tokens": 123,
"completion_tokens": 123
},
"generated_artifacts": {
"items": [
{}
]
},
"search_results": {
"items": [
{}
]
},
"latency": 123,
"labels": {},
"error": "<string>",
"scores": {
"best_models": [],
"candidates": [
{}
]
},
"score": 123,
"temperature": 123,
"max_tokens": 0,
"status_code": 123,
"retries": 0,
"extra": {},
"warning": "<string>"
},
"id": "<string>",
"usage": {
"total_tokens": 123,
"prompt_tokens": 123,
"completion_tokens": 123
},
"model": "<string>",
"object": "text_completion"
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Response
200
application/json
Successful Response
The response returned to the user by the Chat Completions endpoint
Was this page helpful?
curl --request POST \
--url https://api.pulze.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "<string>",
"max_tokens": 123,
"temperature": 0.5,
"top_p": 123,
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {
"type": "object",
"properties": {},
"required": [
"<string>"
]
}
}
}
],
"tool_choice": "none",
"n": 2,
"stream": true,
"logprobs": 2,
"stop": "<string>",
"presence_penalty": 0,
"frequency_penalty": 0,
"best_of": 2,
"logit_bias": {},
"response_format": {
"type": "text"
},
"messages": [
{
"role": "user",
"content": "<string>",
"tool_calls": [
{
"function": {
"arguments": "<string>",
"name": "<string>"
},
"id": "<string>",
"type": "function"
}
]
}
],
"plugins": [
"<string>"
]
}'
{
"choices": [
{
"index": 123,
"finish_reason": "<string>",
"message": {
"role": "user",
"content": "<string>",
"tool_calls": [
{
"function": {
"arguments": "<string>",
"name": "<string>"
},
"id": "<string>",
"type": "function"
}
]
}
}
],
"created": 0,
"metadata": {
"app_id": "<string>",
"model": {
"model": "<string>",
"provider": "<string>",
"owner": "<string>",
"namespace": "<string>",
"at": "<string>"
},
"costs": {
"total_tokens": 123,
"prompt_tokens": 123,
"completion_tokens": 123
},
"cost_savings": {
"total_tokens": 123,
"prompt_tokens": 123,
"completion_tokens": 123
},
"generated_artifacts": {
"items": [
{}
]
},
"search_results": {
"items": [
{}
]
},
"latency": 123,
"labels": {},
"error": "<string>",
"scores": {
"best_models": [],
"candidates": [
{}
]
},
"score": 123,
"temperature": 123,
"max_tokens": 0,
"status_code": 123,
"retries": 0,
"extra": {},
"warning": "<string>"
},
"id": "<string>",
"usage": {
"total_tokens": 123,
"prompt_tokens": 123,
"completion_tokens": 123
},
"model": "<string>",
"object": "text_completion"
}
Assistant
Responses are generated using AI and may contain mistakes.