Criar resposta (API Responses da OpenAI)
post/v1/responses
Cria uma resposta do modelo pela API Responses da OpenAI. Conversas com vários turnos, chamadas de ferramentas e raciocínio são suportados.
Autenticação
Envie sua chave de API da OLETOKEN como token Bearer. As chaves são criadas na página Chaves de API do console.
Authorization: Bearer $OLETOKEN_API_KEYCorpo da requisição
Content-Type:application/json
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| model | string | — | |
| input | string | object[] | — | A entrada, seja uma string ou um array de mensagens |
| instructions | string | — | — |
| max_output_tokens | integer | — | — |
| temperature | number | — | — |
| top_p | number | — | — |
| stream | boolean | — | — |
| tools | object[] | — | — |
| tool_choice | string | object | — | — |
| reasoning | object | — | — |
| effort | stringlowmediumhigh | — | — |
| summary | string | — | — |
| previous_response_id | string | — | — |
| truncation | stringautodisabled | — | — |
Respostas
200Resposta criada
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| id | string | — | — |
| object | string | — | — |
| created_at | integer | — | — |
| status | stringcompletedfailedin_progressincomplete | — | — |
| model | string | — | — |
| output | object[] | — | — |
| type | string | — | — |
| id | string | — | — |
| status | string | — | — |
| role | string | — | — |
| content | object[] | — | — |
| type | string | — | — |
| text | string | — | — |
| usage | Usage | — | — |
| prompt_tokens | integer | — | Número de tokens do prompt |
| completion_tokens | integer | — | Número de tokens de completação |
| total_tokens | integer | — | Número total de tokens |
| prompt_tokens_details | object | — | — |
| cached_tokens | integer | — | — |
| text_tokens | integer | — | — |
| audio_tokens | integer | — | — |
| image_tokens | integer | — | — |
| completion_tokens_details | object | — | — |
| text_tokens | integer | — | — |
| audio_tokens | integer | — | — |
| reasoning_tokens | integer | — | — |
Requisição de exemplo
curl -X POST 'https://api.oletoken.ai/v1/responses' \
-H "Authorization: Bearer $OLETOKEN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "string"
}'
