1. Chat
Power Guard AI
  • Getting Started
    • hello-powerguard (starts here!)
    • ai-controller-guide
    • chat-controller-guide
    • health-controller-guide
    • models-controller-guide
    • usage-controller-guide
  • AI
    • Generate AI responses for form fields
      POST
    • Generate AI text completion
      POST
    • Generate embeddings for input text
      POST
  • Chat
    • Process chat completions
      POST
    • Process chat completions
      POST
  • Health
    • Check API health status
      GET
  • Models
    • List all available models
      GET
    • Get specific model information
      GET
  • Usage
    • Get API usage statistics
      GET
    • Get API usage statistics
      POST
  • Esquemas
    • Schemas
    • CompletionRequest
    • ChatCompletionChoice
    • EmbeddingRequest
    • ChatCompletionFunction
    • FunctionParameters
    • ChatCompletionMessage
    • Message
    • ChatCompletionResponse
    • QuestionModel
    • ChatCompletionToolCall
    • QuestionRequest
    • ChatCompletionUsage
    • Choice
    • QuestionValidationRules
    • Tool
    • ChoiceMessage
    • ToolFunction
    • CompletionResponse
    • DataItem
    • EmbeddingResponse
    • HealthResponseModel
    • ModelCapabilities
    • ModelInfo
    • ResponseModel
    • Role
    • SingleReadOnlyMemory
    • SingleReadOnlySpan
    • Usage
    • UsageModel
    • UsageRequest
  1. Chat

Process chat completions

POST
/v1/chat/completions
Handles both streaming and non-streaming chat completions with model selection and parameter customization

Requisição

Parâmetros Bodyapplication/json

Examples

Respostas

🟢200OK
text/plain
Returns chat completion response
Body

Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://ai.thrust.com.br/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "string",
    "messages": [
        {
            "role": "string",
            "content": null,
            "name": "string",
            "tool_calls": [
                null
            ],
            "tool_call_id": "string"
        }
    ],
    "temperature": 0,
    "top_p": 0,
    "n": 0,
    "stream": true,
    "max_tokens": 0,
    "presence_penalty": 0,
    "frequency_penalty": 0,
    "logit_bias": {
        "property1": 0,
        "property2": 0
    },
    "user": "string",
    "tools": [
        {
            "type": "string",
            "function": {
                "description": "string",
                "name": "string",
                "parameters": {
                    "type": "string",
                    "description": "string",
                    "properties": {
                        "property1": null,
                        "property2": null
                    },
                    "required": [
                        "string"
                    ],
                    "title": "string"
                }
            }
        }
    ],
    "stream_tool_outputs": true
}'
Response Response Example
{
    "id": "string",
    "object": "string",
    "created": 0,
    "model": "string",
    "choices": [
        {
            "index": 0,
            "message": {
                "content": "string",
                "role": "string",
                "tool_calls": [
                    {
                        "type": "string",
                        "function": {
                            "name": "string",
                            "arguments": "string"
                        },
                        "id": "string"
                    }
                ]
            },
            "finish_reason": "string"
        }
    ],
    "usage": {
        "prompt_tokens": 0,
        "completion_tokens": 0,
        "total_tokens": 0
    }
}
Modificado em 2026-03-30 20:59:39
Página anterior
Process chat completions
Próxima página
Check API health status
Built with