Cipta respons (OpenAI Responses API)
post/v1/responses
Cipta respons model melalui OpenAI Responses API. Perbualan berbilang giliran, panggilan alat dan penaakulan disokong.
Pengesahan
Hantar kunci API OLETOKEN sebagai token Bearer. Kunci dicipta di halaman Kunci API dalam konsol.
Authorization: Bearer $OLETOKEN_API_KEYIsi permintaan
Content-Type:application/json
| Medan | Jenis | Wajib | Keterangan |
|---|---|---|---|
| model | string | — | |
| input | string | object[] | — | Input, sama ada rentetan atau tatasusunan mesej |
| 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 dicipta
| Medan | Jenis | 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 | — | Bilangan token prompt |
| completion_tokens | integer | — | Bilangan token penyempurnaan |
| total_tokens | integer | — | Jumlah bilangan 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"
}'
