ngodingdocs

API Reference

OpenAPI: Admin API pelanggan

GET
/v1/organizations/me

Authorization

adminBearerAuth
AuthorizationBearer <token>

Kunci Admin API pelanggan sk-adm-ngd-…. TIDAK berlaku untuk inference; kunci inference tidak berlaku di Admin API.

In: header

Response Body

application/json

curl -X GET "https://example.com/v1/organizations/me"
{  "id": "01JABCD1234EFGH5678JKLMNP",  "type": "organization",  "name": "Budi"}
GET
/v1/organizations/api_keys

Authorization

adminBearerAuth
AuthorizationBearer <token>

Kunci Admin API pelanggan sk-adm-ngd-…. TIDAK berlaku untuk inference; kunci inference tidak berlaku di Admin API.

In: header

Query Parameters

status?string

Value in

  • "active"
  • "inactive"
limit?integer
Range1 <= value <= 1000
Default20
after?string

ID kunci — mulai setelahnya.

order?string

Value in

  • "asc"
  • "desc"

Response Body

application/json

curl -X GET "https://example.com/v1/organizations/api_keys"
{  "data": [    {      "id": "01JABCD1234EFGH5678JKLMNP",      "type": "api_key",      "name": "kunci-ci",      "workspace_id": "wrkspc_default",      "created_at": "2026-09-01T00:00:00Z",      "created_by": {        "id": "01JUSER1234EFGH5678JKLMNP",        "type": "user"      },      "partial_key_hint": "sk-ngd-Ab3X9",      "status": "active"    }  ],  "has_more": false,  "first_id": "01JABCD1234EFGH5678JKLMNP",  "last_id": "01JABCD1234EFGH5678JKLMNP"}
POST
/v1/organizations/api_keys

Authorization

adminBearerAuth
AuthorizationBearer <token>

Kunci Admin API pelanggan sk-adm-ngd-…. TIDAK berlaku untuk inference; kunci inference tidak berlaku di Admin API.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/v1/organizations/api_keys" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "id": "01JABCD1234EFGH5678JKLMNP",  "type": "api_key",  "name": "kunci-ci",  "workspace_id": "wrkspc_default",  "created_at": "2026-09-01T00:00:00Z",  "created_by": {    "id": "01JUSER1234EFGH5678JKLMNP",    "type": "user"  },  "partial_key_hint": "sk-ngd-Ab3X9",  "status": "active",  "key": "sk-ngd-Ab3X9qW7eR2tY6uI4oP8sD1fG5hJ0kL3mN"}
GET
/v1/organizations/api_keys/{id}

Authorization

adminBearerAuth
AuthorizationBearer <token>

Kunci Admin API pelanggan sk-adm-ngd-…. TIDAK berlaku untuk inference; kunci inference tidak berlaku di Admin API.

In: header

Path Parameters

id*string

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/organizations/api_keys/string"
{  "id": "string",  "type": "api_key",  "name": "string",  "workspace_id": "wrkspc_default",  "created_at": "2019-08-24T14:15:22Z",  "created_by": {    "id": "string",    "type": "user"  },  "partial_key_hint": "string",  "status": "active"}
POST
/v1/organizations/api_keys/{id}

Authorization

adminBearerAuth
AuthorizationBearer <token>

Kunci Admin API pelanggan sk-adm-ngd-…. TIDAK berlaku untuk inference; kunci inference tidak berlaku di Admin API.

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/v1/organizations/api_keys/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "type": "api_key",  "name": "string",  "workspace_id": "wrkspc_default",  "created_at": "2019-08-24T14:15:22Z",  "created_by": {    "id": "string",    "type": "user"  },  "partial_key_hint": "string",  "status": "active"}
GET
/v1/organizations/usage_report/messages

Authorization

adminBearerAuth
AuthorizationBearer <token>

Kunci Admin API pelanggan sk-adm-ngd-…. TIDAK berlaku untuk inference; kunci inference tidak berlaku di Admin API.

In: header

Query Parameters

starting_at?string

ISO 8601 (YYYY-MM-DD atau unix juga diterima). Default 7 hari lalu.

Formatdate-time
ending_at?string

Default sekarang.

Formatdate-time
bucket_width?string
Default"1d"

Value in

  • "1d"
  • "1h"
group_by?array<>

Bisa diulang atau koma (group_by[]= juga diterima).

models?string

Saring model (bisa diulang/koma; alias models[], model_ids).

api_key_ids?string

Saring kunci (alias api_key_ids[], api_key_id).

limit?integer

Jumlah bucket per halaman.

Range1 <= value <= 1000
Default20
page?integer
Range1 <= value
Default1

Response Body

application/json

curl -X GET "https://example.com/v1/organizations/usage_report/messages"
{  "data": [    {      "starting_at": "2026-09-28T00:00:00Z",      "ending_at": "2026-09-29T00:00:00Z",      "results": [        {          "uncached_input_tokens": 1200,          "cache_read_input_tokens": 800,          "cache_creation": {            "ephemeral_5m_input_tokens": 0,            "ephemeral_1h_input_tokens": 0          },          "output_tokens": 300,          "server_tool_use": {            "web_search_requests": 0          },          "model": "claude-haiku-4-5",          "workspace_id": "wrkspc_default",          "service_tier": "standard",          "context_window": 200000        }      ]    }  ],  "has_more": false,  "next_page": null}
GET
/v1/organizations/cost_report

Authorization

adminBearerAuth
AuthorizationBearer <token>

Kunci Admin API pelanggan sk-adm-ngd-…. TIDAK berlaku untuk inference; kunci inference tidak berlaku di Admin API.

In: header

Query Parameters

starting_at?string
Formatdate-time
ending_at?string
Formatdate-time
group_by?"description"

Bentuk group_by[]=description juga diterima.

Value in

  • "description"
models?string

Saring model (bisa diulang/koma).

Response Body

application/json

curl -X GET "https://example.com/v1/organizations/cost_report"
{  "results": [    {      "currency": "IDR",      "amount": "15000",      "credits": "150",      "description": "claude-haiku-4-5 tokens",      "cost_type": "tokens",      "model": "claude-haiku-4-5",      "token_type": "all",      "service_tier": "standard"    }  ]}
GET
/v1/organization/projects

Authorization

adminBearerAuth
AuthorizationBearer <token>

Kunci Admin API pelanggan sk-adm-ngd-…. TIDAK berlaku untuk inference; kunci inference tidak berlaku di Admin API.

In: header

Response Body

application/json

curl -X GET "https://example.com/v1/organization/projects"
{  "object": "list",  "data": [    {      "id": "proj_default",      "object": "organization.project",      "name": "Default",      "created_at": 1756684800,      "status": "active"    }  ]}
GET
/v1/organization/projects/proj_default/api_keys

Authorization

adminBearerAuth
AuthorizationBearer <token>

Kunci Admin API pelanggan sk-adm-ngd-…. TIDAK berlaku untuk inference; kunci inference tidak berlaku di Admin API.

In: header

Query Parameters

limit?integer
Range1 <= value <= 10000
Default20

Response Body

application/json

curl -X GET "https://example.com/v1/organization/projects/proj_default/api_keys"
{  "object": "list",  "data": [    {      "object": "organization.project.api_key",      "id": "01JABCD1234EFGH5678JKLMNP",      "name": "kunci-ci",      "redacted_value": "sk-ngd-Ab3X9...",      "created_at": 1756684800,      "last_used_at": null,      "owner": {        "type": "user"      }    }  ],  "first_id": "01JABCD1234EFGH5678JKLMNP",  "last_id": "01JABCD1234EFGH5678JKLMNP",  "has_more": false}
POST
/v1/organization/projects/proj_default/api_keys

Authorization

adminBearerAuth
AuthorizationBearer <token>

Kunci Admin API pelanggan sk-adm-ngd-…. TIDAK berlaku untuk inference; kunci inference tidak berlaku di Admin API.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/v1/organization/projects/proj_default/api_keys" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "object": "organization.project.api_key",  "id": "string",  "name": "string",  "redacted_value": "string",  "created_at": 0,  "last_used_at": 0,  "owner": {    "type": "user"  },  "value": "string"}
GET
/v1/organization/projects/proj_default/api_keys/{id}

Authorization

adminBearerAuth
AuthorizationBearer <token>

Kunci Admin API pelanggan sk-adm-ngd-…. TIDAK berlaku untuk inference; kunci inference tidak berlaku di Admin API.

In: header

Path Parameters

id*string

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/organization/projects/proj_default/api_keys/string"
{  "object": "organization.project.api_key",  "id": "string",  "name": "string",  "redacted_value": "string",  "created_at": 0,  "last_used_at": 0,  "owner": {    "type": "user"  }}
DELETE
/v1/organization/projects/proj_default/api_keys/{id}

Authorization

adminBearerAuth
AuthorizationBearer <token>

Kunci Admin API pelanggan sk-adm-ngd-…. TIDAK berlaku untuk inference; kunci inference tidak berlaku di Admin API.

In: header

Path Parameters

id*string

Response Body

application/json

curl -X DELETE "https://example.com/v1/organization/projects/proj_default/api_keys/string"
{  "object": "organization.project.api_key.deleted",  "id": "01JABCD1234EFGH5678JKLMNP",  "deleted": true}
GET
/v1/organization/usage/completions

Authorization

adminBearerAuth
AuthorizationBearer <token>

Kunci Admin API pelanggan sk-adm-ngd-…. TIDAK berlaku untuk inference; kunci inference tidak berlaku di Admin API.

In: header

Query Parameters

start_time?integer

Unix detik (ISO/YYYY-MM-DD juga diterima). Default 7 hari lalu.

end_time?integer
bucket_width?string
Default"1d"

Value in

  • "1d"
  • "1h"
group_by?array<>
limit?integer
Range1 <= value <= 10000
Default20
page?integer
Range1 <= value
Default1

Response Body

application/json

curl -X GET "https://example.com/v1/organization/usage/completions"
{  "object": "page",  "data": [    {      "object": "bucket",      "start_time": 1756684800,      "end_time": 1756771200,      "results": [        {          "object": "organization.usage.completions.result",          "input_tokens": 2000,          "input_cached_tokens": 800,          "output_tokens": 300,          "num_model_requests": 5,          "model": "gpt-6-luna",          "api_key_id": "01JABCD1234EFGH5678JKLMNP",          "project_id": "proj_default",          "batch": false        }      ]    }  ],  "has_more": false,  "next_page": null}
GET
/v1/organization/costs

Authorization

adminBearerAuth
AuthorizationBearer <token>

Kunci Admin API pelanggan sk-adm-ngd-…. TIDAK berlaku untuk inference; kunci inference tidak berlaku di Admin API.

In: header

Query Parameters

start_time?integer
end_time?integer
bucket_width?"1d"

Value in

  • "1d"
group_by?"line_item"

Value in

  • "line_item"

Response Body

application/json

curl -X GET "https://example.com/v1/organization/costs"
{  "results": [    {      "object": "organization.costs.result",      "amount": {        "value": 15000,        "currency": "idr"      },      "credits": "150",      "line_item": "gpt-6-luna tokens",      "project_id": "proj_default"    }  ]}