Usage for this key
curl --request GET \
--url https://gateway.apiosk.com/v2/usage \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://gateway.apiosk.com/v2/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"month_start": "2023-11-07T05:31:56Z",
"month_spent": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"charges": [
{
"id": "<string>",
"status": "charged",
"cost": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"created_at": "2023-11-07T05:31:56Z",
"source_id": "<string>",
"operation": "<string>",
"name": "<string>",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}API Reference
Usage for this key
Free. This month’s spending and recent charges. Requires billing:read.
GET
/
v2
/
usage
Usage for this key
curl --request GET \
--url https://gateway.apiosk.com/v2/usage \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://gateway.apiosk.com/v2/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"month_start": "2023-11-07T05:31:56Z",
"month_spent": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"charges": [
{
"id": "<string>",
"status": "charged",
"cost": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"created_at": "2023-11-07T05:31:56Z",
"source_id": "<string>",
"operation": "<string>",
"name": "<string>",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}{
"error": {
"code": "invalid_source_input",
"message": "<string>",
"required_scope": "<string>",
"limit": "per_request",
"required": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"available": {
"amount": 0.023,
"amount_micro_usd": "23000",
"currency": "USD"
},
"field": "<string>",
"missing": [
"<string>"
],
"expected": [
"<string>"
],
"operations": [
"<string>"
],
"retry_after_ms": 123
}
}Authorizations
An organisation API key: Authorization: Bearer apk_org_live_…
Query Parameters
Required range:
1 <= x <= 200