Buat respons (OpenAI Responses API)
post/v1/responses
Buat respons model melalui OpenAI Responses API. Percakapan multi-turn, pemanggilan tool, dan reasoning didukung.
Autentikasi
Kirim kunci API OLETOKEN sebagai token Bearer. Kunci dibuat di halaman Kunci API pada konsol.
Authorization: Bearer $OLETOKEN_API_KEYIsi permintaan
Content-Type:application/json
| Field | Tipe | Wajib | Keterangan |
|---|---|---|---|
| model | string | — | |
| input | string | object[] | — | Input, berupa string atau array pesan |
| 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 | — | — |
Respons
200Respons dibuat
| Field | Tipe | Wajib | Keterangan |
|---|---|---|---|
| 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 | — | Jumlah token prompt |
| completion_tokens | integer | — | Jumlah token completion |
| total_tokens | integer | — | Jumlah total token |
| 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 | — | — |
Contoh permintaan
curl -X POST 'https://api.oletoken.ai/v1/responses' \
-H "Authorization: Bearer $OLETOKEN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "string"
}'
