ngodingdocs

API Reference

OpenAPI: Responses

POST
/v1/responses

Authorization

AuthorizationBearer <token>

Kunci inference sk-ngd- + 40 karakter base62. Plaintext hanya ditampilkan sekali saat dibuat di dashboard.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/responses" \  -H "Content-Type: application/json" \  -d '{    "model": "gpt-6-luna",    "input": "Apa kabar terbaru soal tarif KRL Jabodetabek? Sertakan sumber.",    "tools": [      {        "type": "web_search",        "search_context_size": "low"      }    ],    "max_tool_calls": 4  }'
{  "id": "resp_01JB5Q8YH0R6",  "object": "response",  "status": "completed",  "incomplete_details": null,  "model": "gpt-6-luna",  "output": [    {      "id": "msg_01JB5Q8YH1A1",      "type": "message",      "status": "completed",      "role": "assistant",      "content": [        {          "type": "output_text",          "text": "Saya cari dulu.",          "annotations": []        }      ]    },    {      "id": "ws_01JB5Q8YH4K2",      "type": "web_search_call",      "status": "completed",      "action": {        "type": "search",        "query": "tarif KRL Jabodetabek terbaru",        "sources": [          {            "type": "url",            "url": "https://contoh.id/berita/tarif-krl"          }        ]      }    },    {      "id": "msg_01JB5Q8YH7M3",      "type": "message",      "status": "completed",      "role": "assistant",      "content": [        {          "type": "output_text",          "text": "Menurut [Tarif KRL 2026](https://contoh.id/berita/tarif-krl), tarif dasar belum berubah.",          "annotations": [            {              "type": "url_citation",              "start_index": 8,              "end_index": 60,              "url": "https://contoh.id/berita/tarif-krl",              "title": "Tarif KRL 2026"            }          ]        }      ]    }  ],  "usage": {    "input_tokens": 4210,    "output_tokens": 180,    "total_tokens": 4390  }}