334 334
335 When `group_by=project_id`, this field provides the project ID of the grouped usage result.335 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
336 336
337 - `CostsResult object { object, amount, line_item, project_id }`337 - `CostsResult object { object, amount, api_key_id, 2 more }`
338 338
339 The aggregated costs details of the specific time bucket.339 The aggregated costs details of the specific time bucket.
340 340
354 354
355 The numeric value of the cost.355 The numeric value of the cost.
356 356
357 - `api_key_id: optional string`
358
359 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
360
357 - `line_item: optional string`361 - `line_item: optional string`
358 362
359 When `group_by=line_item`, this field provides the line item of the grouped costs result.363 When `group_by=line_item`, this field provides the line item of the grouped costs result.
376 380
377```http381```http
378curl https://api.openai.com/v1/organization/usage/audio_speeches \382curl https://api.openai.com/v1/organization/usage/audio_speeches \
379 -H "Authorization: Bearer $OPENAI_API_KEY"383 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"
380```384```
381 385
382#### Response386#### Response
783 787
784 When `group_by=project_id`, this field provides the project ID of the grouped usage result.788 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
785 789
786 - `CostsResult object { object, amount, line_item, project_id }`790 - `CostsResult object { object, amount, api_key_id, 2 more }`
787 791
788 The aggregated costs details of the specific time bucket.792 The aggregated costs details of the specific time bucket.
789 793
803 807
804 The numeric value of the cost.808 The numeric value of the cost.
805 809
810 - `api_key_id: optional string`
811
812 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
813
806 - `line_item: optional string`814 - `line_item: optional string`
807 815
808 When `group_by=line_item`, this field provides the line item of the grouped costs result.816 When `group_by=line_item`, this field provides the line item of the grouped costs result.
825 833
826```http834```http
827curl https://api.openai.com/v1/organization/usage/audio_transcriptions \835curl https://api.openai.com/v1/organization/usage/audio_transcriptions \
828 -H "Authorization: Bearer $OPENAI_API_KEY"836 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"
829```837```
830 838
831#### Response839#### Response
1214 1222
1215 When `group_by=project_id`, this field provides the project ID of the grouped usage result.1223 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
1216 1224
1217 - `CostsResult object { object, amount, line_item, project_id }`1225 - `CostsResult object { object, amount, api_key_id, 2 more }`
1218 1226
1219 The aggregated costs details of the specific time bucket.1227 The aggregated costs details of the specific time bucket.
1220 1228
1234 1242
1235 The numeric value of the cost.1243 The numeric value of the cost.
1236 1244
1245 - `api_key_id: optional string`
1246
1247 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
1248
1237 - `line_item: optional string`1249 - `line_item: optional string`
1238 1250
1239 When `group_by=line_item`, this field provides the line item of the grouped costs result.1251 When `group_by=line_item`, this field provides the line item of the grouped costs result.
1256 1268
1257```http1269```http
1258curl https://api.openai.com/v1/organization/usage/code_interpreter_sessions \1270curl https://api.openai.com/v1/organization/usage/code_interpreter_sessions \
1259 -H "Authorization: Bearer $OPENAI_API_KEY"1271 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"
1260```1272```
1261 1273
1262#### Response1274#### Response
1667 1679
1668 When `group_by=project_id`, this field provides the project ID of the grouped usage result.1680 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
1669 1681
1670 - `CostsResult object { object, amount, line_item, project_id }`1682 - `CostsResult object { object, amount, api_key_id, 2 more }`
1671 1683
1672 The aggregated costs details of the specific time bucket.1684 The aggregated costs details of the specific time bucket.
1673 1685
1687 1699
1688 The numeric value of the cost.1700 The numeric value of the cost.
1689 1701
1702 - `api_key_id: optional string`
1703
1704 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
1705
1690 - `line_item: optional string`1706 - `line_item: optional string`
1691 1707
1692 When `group_by=line_item`, this field provides the line item of the grouped costs result.1708 When `group_by=line_item`, this field provides the line item of the grouped costs result.
1709 1725
1710```http1726```http
1711curl https://api.openai.com/v1/organization/usage/completions \1727curl https://api.openai.com/v1/organization/usage/completions \
1712 -H "Authorization: Bearer $OPENAI_API_KEY"1728 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"
1713```1729```
1714 1730
1715#### Response1731#### Response
2122 2138
2123 When `group_by=project_id`, this field provides the project ID of the grouped usage result.2139 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
2124 2140
2125 - `CostsResult object { object, amount, line_item, project_id }`2141 - `CostsResult object { object, amount, api_key_id, 2 more }`
2126 2142
2127 The aggregated costs details of the specific time bucket.2143 The aggregated costs details of the specific time bucket.
2128 2144
2142 2158
2143 The numeric value of the cost.2159 The numeric value of the cost.
2144 2160
2161 - `api_key_id: optional string`
2162
2163 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
2164
2145 - `line_item: optional string`2165 - `line_item: optional string`
2146 2166
2147 When `group_by=line_item`, this field provides the line item of the grouped costs result.2167 When `group_by=line_item`, this field provides the line item of the grouped costs result.
2164 2184
2165```http2185```http
2166curl https://api.openai.com/v1/organization/usage/embeddings \2186curl https://api.openai.com/v1/organization/usage/embeddings \
2167 -H "Authorization: Bearer $OPENAI_API_KEY"2187 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"
2168```2188```
2169 2189
2170#### Response2190#### Response
2599 2619
2600 When `group_by=project_id`, this field provides the project ID of the grouped usage result.2620 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
2601 2621
2602 - `CostsResult object { object, amount, line_item, project_id }`2622 - `CostsResult object { object, amount, api_key_id, 2 more }`
2603 2623
2604 The aggregated costs details of the specific time bucket.2624 The aggregated costs details of the specific time bucket.
2605 2625
2619 2639
2620 The numeric value of the cost.2640 The numeric value of the cost.
2621 2641
2642 - `api_key_id: optional string`
2643
2644 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
2645
2622 - `line_item: optional string`2646 - `line_item: optional string`
2623 2647
2624 When `group_by=line_item`, this field provides the line item of the grouped costs result.2648 When `group_by=line_item`, this field provides the line item of the grouped costs result.
2641 2665
2642```http2666```http
2643curl https://api.openai.com/v1/organization/usage/images \2667curl https://api.openai.com/v1/organization/usage/images \
2644 -H "Authorization: Bearer $OPENAI_API_KEY"2668 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"
2645```2669```
2646 2670
2647#### Response2671#### Response
3050 3074
3051 When `group_by=project_id`, this field provides the project ID of the grouped usage result.3075 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
3052 3076
3053 - `CostsResult object { object, amount, line_item, project_id }`3077 - `CostsResult object { object, amount, api_key_id, 2 more }`
3054 3078
3055 The aggregated costs details of the specific time bucket.3079 The aggregated costs details of the specific time bucket.
3056 3080
3070 3094
3071 The numeric value of the cost.3095 The numeric value of the cost.
3072 3096
3097 - `api_key_id: optional string`
3098
3099 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
3100
3073 - `line_item: optional string`3101 - `line_item: optional string`
3074 3102
3075 When `group_by=line_item`, this field provides the line item of the grouped costs result.3103 When `group_by=line_item`, this field provides the line item of the grouped costs result.
3092 3120
3093```http3121```http
3094curl https://api.openai.com/v1/organization/usage/moderations \3122curl https://api.openai.com/v1/organization/usage/moderations \
3095 -H "Authorization: Bearer $OPENAI_API_KEY"3123 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"
3096```3124```
3097 3125
3098#### Response3126#### Response
3481 3509
3482 When `group_by=project_id`, this field provides the project ID of the grouped usage result.3510 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
3483 3511
3484 - `CostsResult object { object, amount, line_item, project_id }`3512 - `CostsResult object { object, amount, api_key_id, 2 more }`
3485 3513
3486 The aggregated costs details of the specific time bucket.3514 The aggregated costs details of the specific time bucket.
3487 3515
3501 3529
3502 The numeric value of the cost.3530 The numeric value of the cost.
3503 3531
3532 - `api_key_id: optional string`
3533
3534 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
3535
3504 - `line_item: optional string`3536 - `line_item: optional string`
3505 3537
3506 When `group_by=line_item`, this field provides the line item of the grouped costs result.3538 When `group_by=line_item`, this field provides the line item of the grouped costs result.
3523 3555
3524```http3556```http
3525curl https://api.openai.com/v1/organization/usage/vector_stores \3557curl https://api.openai.com/v1/organization/usage/vector_stores \
3526 -H "Authorization: Bearer $OPENAI_API_KEY"3558 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"
3527```3559```
3528 3560
3529#### Response3561#### Response
3592}3624}
3593```3625```
3594 3626
3595## Domain Types3627## Costs
3596 3628
3597### Usage Get Audio Speeches Response3629**get** `/organization/costs`
3598 3630
3599- `UsageGetAudioSpeechesResponse object { data, has_more, next_page, object }`3631Get costs details for the organization.
3600 3632
3601 - `data: array of object { end_time, object, result, start_time }`3633### Query Parameters
3634
3635- `start_time: number`
3636
3637 Start time (Unix seconds) of the query time range, inclusive.
3638
3639- `api_key_ids: optional array of string`
3640
3641 Return only costs for these API keys.
3642
3643- `bucket_width: optional "1d"`
3644
3645 Width of each time bucket in response. Currently only `1d` is supported, default to `1d`.
3646
3647 - `"1d"`
3648
3649- `end_time: optional number`
3650
3651 End time (Unix seconds) of the query time range, exclusive.
3652
3653- `group_by: optional array of "project_id" or "line_item" or "api_key_id"`
3654
3655 Group the costs by the specified fields. Support fields include `project_id`, `line_item`, `api_key_id` and any combination of them.
3656
3657 - `"project_id"`
3658
3659 - `"line_item"`
3660
3661 - `"api_key_id"`
3662
3663- `limit: optional number`
3664
3665 A limit on the number of buckets to be returned. Limit can range between 1 and 180, and the default is 7.
3666
3667- `page: optional string`
3668
3669 A cursor for use in pagination. Corresponding to the `next_page` field from the previous response.
3670
3671- `project_ids: optional array of string`
3672
3673 Return only costs for these projects.
3674
3675### Returns
3676
3677- `data: array of object { end_time, object, result, start_time }`
3602 3678
3603 - `end_time: number`3679 - `end_time: number`
3604 3680
3864 3940
3865 When `group_by=project_id`, this field provides the project ID of the grouped usage result.3941 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
3866 3942
3867 - `CostsResult object { object, amount, line_item, project_id }`3943 - `CostsResult object { object, amount, api_key_id, 2 more }`
3868 3944
3869 The aggregated costs details of the specific time bucket.3945 The aggregated costs details of the specific time bucket.
3870 3946
3884 3960
3885 The numeric value of the cost.3961 The numeric value of the cost.
3886 3962
3963 - `api_key_id: optional string`
3964
3965 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
3966
3887 - `line_item: optional string`3967 - `line_item: optional string`
3888 3968
3889 When `group_by=line_item`, this field provides the line item of the grouped costs result.3969 When `group_by=line_item`, this field provides the line item of the grouped costs result.
3894 3974
3895 - `start_time: number`3975 - `start_time: number`
3896 3976
3897 - `has_more: boolean`3977- `has_more: boolean`
3898 3978
3899 - `next_page: string`3979- `next_page: string`
3900 3980
3901 - `object: "page"`3981- `object: "page"`
3902 3982
3903 - `"page"`3983 - `"page"`
3904 3984
3905### Usage Get Audio Transcriptions Response3985### Example
3986
3987```http
3988curl https://api.openai.com/v1/organization/costs \
3989 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"
3990```
3991
3992#### Response
3993
3994```json
3995{
3996 "data": [
3997 {
3998 "end_time": 0,
3999 "object": "bucket",
4000 "result": [
4001 {
4002 "input_tokens": 0,
4003 "num_model_requests": 0,
4004 "object": "organization.usage.completions.result",
4005 "output_tokens": 0,
4006 "api_key_id": "api_key_id",
4007 "batch": true,
4008 "input_audio_tokens": 0,
4009 "input_cached_tokens": 0,
4010 "model": "model",
4011 "output_audio_tokens": 0,
4012 "project_id": "project_id",
4013 "service_tier": "service_tier",
4014 "user_id": "user_id"
4015 }
4016 ],
4017 "start_time": 0
4018 }
4019 ],
4020 "has_more": true,
4021 "next_page": "next_page",
4022 "object": "page"
4023}
4024```
4025
4026### Example
4027
4028```http
4029curl "https://api.openai.com/v1/organization/costs?start_time=1730419200&limit=1" \
4030-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
4031-H "Content-Type: application/json"
4032```
4033
4034#### Response
4035
4036```json
4037{
4038 "object": "page",
4039 "data": [
4040 {
4041 "object": "bucket",
4042 "start_time": 1730419200,
4043 "end_time": 1730505600,
4044 "results": [
4045 {
4046 "object": "organization.costs.result",
4047 "amount": {
4048 "value": 0.06,
4049 "currency": "usd"
4050 },
4051 "line_item": null,
4052 "project_id": null,
4053 "api_key_id": null
4054 }
4055 ]
4056 }
4057 ],
4058 "has_more": false,
4059 "next_page": null
4060}
4061```
4062
4063## Domain Types
4064
4065### Usage Audio Speeches Response
3906 4066
3907- `UsageGetAudioTranscriptionsResponse object { data, has_more, next_page, object }`4067- `UsageAudioSpeechesResponse object { data, has_more, next_page, object }`
3908 4068
3909 - `data: array of object { end_time, object, result, start_time }`4069 - `data: array of object { end_time, object, result, start_time }`
3910 4070
4172 4332
4173 When `group_by=project_id`, this field provides the project ID of the grouped usage result.4333 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
4174 4334
4175 - `CostsResult object { object, amount, line_item, project_id }`4335 - `CostsResult object { object, amount, api_key_id, 2 more }`
4176 4336
4177 The aggregated costs details of the specific time bucket.4337 The aggregated costs details of the specific time bucket.
4178 4338
4192 4352
4193 The numeric value of the cost.4353 The numeric value of the cost.
4194 4354
4355 - `api_key_id: optional string`
4356
4357 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
4358
4195 - `line_item: optional string`4359 - `line_item: optional string`
4196 4360
4197 When `group_by=line_item`, this field provides the line item of the grouped costs result.4361 When `group_by=line_item`, this field provides the line item of the grouped costs result.
4210 4374
4211 - `"page"`4375 - `"page"`
4212 4376
4213### Usage Get Code Interpreter Sessions Response4377### Usage Audio Transcriptions Response
4214 4378
4215- `UsageGetCodeInterpreterSessionsResponse object { data, has_more, next_page, object }`4379- `UsageAudioTranscriptionsResponse object { data, has_more, next_page, object }`
4216 4380
4217 - `data: array of object { end_time, object, result, start_time }`4381 - `data: array of object { end_time, object, result, start_time }`
4218 4382
4480 4644
4481 When `group_by=project_id`, this field provides the project ID of the grouped usage result.4645 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
4482 4646
4483 - `CostsResult object { object, amount, line_item, project_id }`4647 - `CostsResult object { object, amount, api_key_id, 2 more }`
4484 4648
4485 The aggregated costs details of the specific time bucket.4649 The aggregated costs details of the specific time bucket.
4486 4650
4500 4664
4501 The numeric value of the cost.4665 The numeric value of the cost.
4502 4666
4667 - `api_key_id: optional string`
4668
4669 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
4670
4503 - `line_item: optional string`4671 - `line_item: optional string`
4504 4672
4505 When `group_by=line_item`, this field provides the line item of the grouped costs result.4673 When `group_by=line_item`, this field provides the line item of the grouped costs result.
4518 4686
4519 - `"page"`4687 - `"page"`
4520 4688
4521### Usage Get Completions Response4689### Usage Code Interpreter Sessions Response
4522 4690
4523- `UsageGetCompletionsResponse object { data, has_more, next_page, object }`4691- `UsageCodeInterpreterSessionsResponse object { data, has_more, next_page, object }`
4524 4692
4525 - `data: array of object { end_time, object, result, start_time }`4693 - `data: array of object { end_time, object, result, start_time }`
4526 4694
4788 4956
4789 When `group_by=project_id`, this field provides the project ID of the grouped usage result.4957 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
4790 4958
4791 - `CostsResult object { object, amount, line_item, project_id }`4959 - `CostsResult object { object, amount, api_key_id, 2 more }`
4792 4960
4793 The aggregated costs details of the specific time bucket.4961 The aggregated costs details of the specific time bucket.
4794 4962
4808 4976
4809 The numeric value of the cost.4977 The numeric value of the cost.
4810 4978
4979 - `api_key_id: optional string`
4980
4981 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
4982
4811 - `line_item: optional string`4983 - `line_item: optional string`
4812 4984
4813 When `group_by=line_item`, this field provides the line item of the grouped costs result.4985 When `group_by=line_item`, this field provides the line item of the grouped costs result.
4826 4998
4827 - `"page"`4999 - `"page"`
4828 5000
4829### Usage Get Embeddings Response5001### Usage Completions Response
4830 5002
4831- `UsageGetEmbeddingsResponse object { data, has_more, next_page, object }`5003- `UsageCompletionsResponse object { data, has_more, next_page, object }`
4832 5004
4833 - `data: array of object { end_time, object, result, start_time }`5005 - `data: array of object { end_time, object, result, start_time }`
4834 5006
5096 5268
5097 When `group_by=project_id`, this field provides the project ID of the grouped usage result.5269 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
5098 5270
5099 - `CostsResult object { object, amount, line_item, project_id }`5271 - `CostsResult object { object, amount, api_key_id, 2 more }`
5100 5272
5101 The aggregated costs details of the specific time bucket.5273 The aggregated costs details of the specific time bucket.
5102 5274
5116 5288
5117 The numeric value of the cost.5289 The numeric value of the cost.
5118 5290
5291 - `api_key_id: optional string`
5292
5293 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
5294
5119 - `line_item: optional string`5295 - `line_item: optional string`
5120 5296
5121 When `group_by=line_item`, this field provides the line item of the grouped costs result.5297 When `group_by=line_item`, this field provides the line item of the grouped costs result.
5134 5310
5135 - `"page"`5311 - `"page"`
5136 5312
5137### Usage Get Images Response5313### Usage Embeddings Response
5138 5314
5139- `UsageGetImagesResponse object { data, has_more, next_page, object }`5315- `UsageEmbeddingsResponse object { data, has_more, next_page, object }`
5140 5316
5141 - `data: array of object { end_time, object, result, start_time }`5317 - `data: array of object { end_time, object, result, start_time }`
5142 5318
5404 5580
5405 When `group_by=project_id`, this field provides the project ID of the grouped usage result.5581 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
5406 5582
5407 - `CostsResult object { object, amount, line_item, project_id }`5583 - `CostsResult object { object, amount, api_key_id, 2 more }`
5408 5584
5409 The aggregated costs details of the specific time bucket.5585 The aggregated costs details of the specific time bucket.
5410 5586
5424 5600
5425 The numeric value of the cost.5601 The numeric value of the cost.
5426 5602
5603 - `api_key_id: optional string`
5604
5605 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
5606
5427 - `line_item: optional string`5607 - `line_item: optional string`
5428 5608
5429 When `group_by=line_item`, this field provides the line item of the grouped costs result.5609 When `group_by=line_item`, this field provides the line item of the grouped costs result.
5442 5622
5443 - `"page"`5623 - `"page"`
5444 5624
5445### Usage Get Moderations Response5625### Usage Images Response
5446 5626
5447- `UsageGetModerationsResponse object { data, has_more, next_page, object }`5627- `UsageImagesResponse object { data, has_more, next_page, object }`
5448 5628
5449 - `data: array of object { end_time, object, result, start_time }`5629 - `data: array of object { end_time, object, result, start_time }`
5450 5630
5712 5892
5713 When `group_by=project_id`, this field provides the project ID of the grouped usage result.5893 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
5714 5894
5715 - `CostsResult object { object, amount, line_item, project_id }`5895 - `CostsResult object { object, amount, api_key_id, 2 more }`
5716 5896
5717 The aggregated costs details of the specific time bucket.5897 The aggregated costs details of the specific time bucket.
5718 5898
5732 5912
5733 The numeric value of the cost.5913 The numeric value of the cost.
5734 5914
5915 - `api_key_id: optional string`
5916
5917 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
5918
5735 - `line_item: optional string`5919 - `line_item: optional string`
5736 5920
5737 When `group_by=line_item`, this field provides the line item of the grouped costs result.5921 When `group_by=line_item`, this field provides the line item of the grouped costs result.
5750 5934
5751 - `"page"`5935 - `"page"`
5752 5936
5753### Usage Get Vector Stores Response5937### Usage Moderations Response
5754 5938
5755- `UsageGetVectorStoresResponse object { data, has_more, next_page, object }`5939- `UsageModerationsResponse object { data, has_more, next_page, object }`
5756 5940
5757 - `data: array of object { end_time, object, result, start_time }`5941 - `data: array of object { end_time, object, result, start_time }`
5758 5942
6020 6204
6021 When `group_by=project_id`, this field provides the project ID of the grouped usage result.6205 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6022 6206
6023 - `CostsResult object { object, amount, line_item, project_id }`6207 - `CostsResult object { object, amount, api_key_id, 2 more }`
6024 6208
6025 The aggregated costs details of the specific time bucket.6209 The aggregated costs details of the specific time bucket.
6026 6210
6040 6224
6041 The numeric value of the cost.6225 The numeric value of the cost.
6042 6226
6227 - `api_key_id: optional string`
6228
6229 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
6230
6231 - `line_item: optional string`
6232
6233 When `group_by=line_item`, this field provides the line item of the grouped costs result.
6234
6235 - `project_id: optional string`
6236
6237 When `group_by=project_id`, this field provides the project ID of the grouped costs result.
6238
6239 - `start_time: number`
6240
6241 - `has_more: boolean`
6242
6243 - `next_page: string`
6244
6245 - `object: "page"`
6246
6247 - `"page"`
6248
6249### Usage Vector Stores Response
6250
6251- `UsageVectorStoresResponse object { data, has_more, next_page, object }`
6252
6253 - `data: array of object { end_time, object, result, start_time }`
6254
6255 - `end_time: number`
6256
6257 - `object: "bucket"`
6258
6259 - `"bucket"`
6260
6261 - `result: array of object { input_tokens, num_model_requests, object, 10 more } or object { input_tokens, num_model_requests, object, 4 more } or object { input_tokens, num_model_requests, object, 4 more } or 6 more`
6262
6263 - `UsageCompletionsResult object { input_tokens, num_model_requests, object, 10 more }`
6264
6265 The aggregated completions usage details of the specific time bucket.
6266
6267 - `input_tokens: number`
6268
6269 The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.
6270
6271 - `num_model_requests: number`
6272
6273 The count of requests made to the model.
6274
6275 - `object: "organization.usage.completions.result"`
6276
6277 - `"organization.usage.completions.result"`
6278
6279 - `output_tokens: number`
6280
6281 The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
6282
6283 - `api_key_id: optional string`
6284
6285 When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
6286
6287 - `batch: optional boolean`
6288
6289 When `group_by=batch`, this field tells whether the grouped usage result is batch or not.
6290
6291 - `input_audio_tokens: optional number`
6292
6293 The aggregated number of audio input tokens used, including cached tokens.
6294
6295 - `input_cached_tokens: optional number`
6296
6297 The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens.
6298
6299 - `model: optional string`
6300
6301 When `group_by=model`, this field provides the model name of the grouped usage result.
6302
6303 - `output_audio_tokens: optional number`
6304
6305 The aggregated number of audio output tokens used.
6306
6307 - `project_id: optional string`
6308
6309 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6310
6311 - `service_tier: optional string`
6312
6313 When `group_by=service_tier`, this field provides the service tier of the grouped usage result.
6314
6315 - `user_id: optional string`
6316
6317 When `group_by=user_id`, this field provides the user ID of the grouped usage result.
6318
6319 - `UsageEmbeddingsResult object { input_tokens, num_model_requests, object, 4 more }`
6320
6321 The aggregated embeddings usage details of the specific time bucket.
6322
6323 - `input_tokens: number`
6324
6325 The aggregated number of input tokens used.
6326
6327 - `num_model_requests: number`
6328
6329 The count of requests made to the model.
6330
6331 - `object: "organization.usage.embeddings.result"`
6332
6333 - `"organization.usage.embeddings.result"`
6334
6335 - `api_key_id: optional string`
6336
6337 When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
6338
6339 - `model: optional string`
6340
6341 When `group_by=model`, this field provides the model name of the grouped usage result.
6342
6343 - `project_id: optional string`
6344
6345 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6346
6347 - `user_id: optional string`
6348
6349 When `group_by=user_id`, this field provides the user ID of the grouped usage result.
6350
6351 - `UsageModerationsResult object { input_tokens, num_model_requests, object, 4 more }`
6352
6353 The aggregated moderations usage details of the specific time bucket.
6354
6355 - `input_tokens: number`
6356
6357 The aggregated number of input tokens used.
6358
6359 - `num_model_requests: number`
6360
6361 The count of requests made to the model.
6362
6363 - `object: "organization.usage.moderations.result"`
6364
6365 - `"organization.usage.moderations.result"`
6366
6367 - `api_key_id: optional string`
6368
6369 When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
6370
6371 - `model: optional string`
6372
6373 When `group_by=model`, this field provides the model name of the grouped usage result.
6374
6375 - `project_id: optional string`
6376
6377 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6378
6379 - `user_id: optional string`
6380
6381 When `group_by=user_id`, this field provides the user ID of the grouped usage result.
6382
6383 - `UsageImagesResult object { images, num_model_requests, object, 6 more }`
6384
6385 The aggregated images usage details of the specific time bucket.
6386
6387 - `images: number`
6388
6389 The number of images processed.
6390
6391 - `num_model_requests: number`
6392
6393 The count of requests made to the model.
6394
6395 - `object: "organization.usage.images.result"`
6396
6397 - `"organization.usage.images.result"`
6398
6399 - `api_key_id: optional string`
6400
6401 When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
6402
6403 - `model: optional string`
6404
6405 When `group_by=model`, this field provides the model name of the grouped usage result.
6406
6407 - `project_id: optional string`
6408
6409 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6410
6411 - `size: optional string`
6412
6413 When `group_by=size`, this field provides the image size of the grouped usage result.
6414
6415 - `source: optional string`
6416
6417 When `group_by=source`, this field provides the source of the grouped usage result, possible values are `image.generation`, `image.edit`, `image.variation`.
6418
6419 - `user_id: optional string`
6420
6421 When `group_by=user_id`, this field provides the user ID of the grouped usage result.
6422
6423 - `UsageAudioSpeechesResult object { characters, num_model_requests, object, 4 more }`
6424
6425 The aggregated audio speeches usage details of the specific time bucket.
6426
6427 - `characters: number`
6428
6429 The number of characters processed.
6430
6431 - `num_model_requests: number`
6432
6433 The count of requests made to the model.
6434
6435 - `object: "organization.usage.audio_speeches.result"`
6436
6437 - `"organization.usage.audio_speeches.result"`
6438
6439 - `api_key_id: optional string`
6440
6441 When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
6442
6443 - `model: optional string`
6444
6445 When `group_by=model`, this field provides the model name of the grouped usage result.
6446
6447 - `project_id: optional string`
6448
6449 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6450
6451 - `user_id: optional string`
6452
6453 When `group_by=user_id`, this field provides the user ID of the grouped usage result.
6454
6455 - `UsageAudioTranscriptionsResult object { num_model_requests, object, seconds, 4 more }`
6456
6457 The aggregated audio transcriptions usage details of the specific time bucket.
6458
6459 - `num_model_requests: number`
6460
6461 The count of requests made to the model.
6462
6463 - `object: "organization.usage.audio_transcriptions.result"`
6464
6465 - `"organization.usage.audio_transcriptions.result"`
6466
6467 - `seconds: number`
6468
6469 The number of seconds processed.
6470
6471 - `api_key_id: optional string`
6472
6473 When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
6474
6475 - `model: optional string`
6476
6477 When `group_by=model`, this field provides the model name of the grouped usage result.
6478
6479 - `project_id: optional string`
6480
6481 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6482
6483 - `user_id: optional string`
6484
6485 When `group_by=user_id`, this field provides the user ID of the grouped usage result.
6486
6487 - `UsageVectorStoresResult object { object, usage_bytes, project_id }`
6488
6489 The aggregated vector stores usage details of the specific time bucket.
6490
6491 - `object: "organization.usage.vector_stores.result"`
6492
6493 - `"organization.usage.vector_stores.result"`
6494
6495 - `usage_bytes: number`
6496
6497 The vector stores usage in bytes.
6498
6499 - `project_id: optional string`
6500
6501 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6502
6503 - `UsageCodeInterpreterSessionsResult object { object, num_sessions, project_id }`
6504
6505 The aggregated code interpreter sessions usage details of the specific time bucket.
6506
6507 - `object: "organization.usage.code_interpreter_sessions.result"`
6508
6509 - `"organization.usage.code_interpreter_sessions.result"`
6510
6511 - `num_sessions: optional number`
6512
6513 The number of code interpreter sessions.
6514
6515 - `project_id: optional string`
6516
6517 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6518
6519 - `CostsResult object { object, amount, api_key_id, 2 more }`
6520
6521 The aggregated costs details of the specific time bucket.
6522
6523 - `object: "organization.costs.result"`
6524
6525 - `"organization.costs.result"`
6526
6527 - `amount: optional object { currency, value }`
6528
6529 The monetary value in its associated currency.
6530
6531 - `currency: optional string`
6532
6533 Lowercase ISO-4217 currency e.g. "usd"
6534
6535 - `value: optional number`
6536
6537 The numeric value of the cost.
6538
6539 - `api_key_id: optional string`
6540
6541 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
6542
6543 - `line_item: optional string`
6544
6545 When `group_by=line_item`, this field provides the line item of the grouped costs result.
6546
6547 - `project_id: optional string`
6548
6549 When `group_by=project_id`, this field provides the project ID of the grouped costs result.
6550
6551 - `start_time: number`
6552
6553 - `has_more: boolean`
6554
6555 - `next_page: string`
6556
6557 - `object: "page"`
6558
6559 - `"page"`
6560
6561### Usage Costs Response
6562
6563- `UsageCostsResponse object { data, has_more, next_page, object }`
6564
6565 - `data: array of object { end_time, object, result, start_time }`
6566
6567 - `end_time: number`
6568
6569 - `object: "bucket"`
6570
6571 - `"bucket"`
6572
6573 - `result: array of object { input_tokens, num_model_requests, object, 10 more } or object { input_tokens, num_model_requests, object, 4 more } or object { input_tokens, num_model_requests, object, 4 more } or 6 more`
6574
6575 - `UsageCompletionsResult object { input_tokens, num_model_requests, object, 10 more }`
6576
6577 The aggregated completions usage details of the specific time bucket.
6578
6579 - `input_tokens: number`
6580
6581 The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.
6582
6583 - `num_model_requests: number`
6584
6585 The count of requests made to the model.
6586
6587 - `object: "organization.usage.completions.result"`
6588
6589 - `"organization.usage.completions.result"`
6590
6591 - `output_tokens: number`
6592
6593 The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
6594
6595 - `api_key_id: optional string`
6596
6597 When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
6598
6599 - `batch: optional boolean`
6600
6601 When `group_by=batch`, this field tells whether the grouped usage result is batch or not.
6602
6603 - `input_audio_tokens: optional number`
6604
6605 The aggregated number of audio input tokens used, including cached tokens.
6606
6607 - `input_cached_tokens: optional number`
6608
6609 The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens.
6610
6611 - `model: optional string`
6612
6613 When `group_by=model`, this field provides the model name of the grouped usage result.
6614
6615 - `output_audio_tokens: optional number`
6616
6617 The aggregated number of audio output tokens used.
6618
6619 - `project_id: optional string`
6620
6621 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6622
6623 - `service_tier: optional string`
6624
6625 When `group_by=service_tier`, this field provides the service tier of the grouped usage result.
6626
6627 - `user_id: optional string`
6628
6629 When `group_by=user_id`, this field provides the user ID of the grouped usage result.
6630
6631 - `UsageEmbeddingsResult object { input_tokens, num_model_requests, object, 4 more }`
6632
6633 The aggregated embeddings usage details of the specific time bucket.
6634
6635 - `input_tokens: number`
6636
6637 The aggregated number of input tokens used.
6638
6639 - `num_model_requests: number`
6640
6641 The count of requests made to the model.
6642
6643 - `object: "organization.usage.embeddings.result"`
6644
6645 - `"organization.usage.embeddings.result"`
6646
6647 - `api_key_id: optional string`
6648
6649 When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
6650
6651 - `model: optional string`
6652
6653 When `group_by=model`, this field provides the model name of the grouped usage result.
6654
6655 - `project_id: optional string`
6656
6657 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6658
6659 - `user_id: optional string`
6660
6661 When `group_by=user_id`, this field provides the user ID of the grouped usage result.
6662
6663 - `UsageModerationsResult object { input_tokens, num_model_requests, object, 4 more }`
6664
6665 The aggregated moderations usage details of the specific time bucket.
6666
6667 - `input_tokens: number`
6668
6669 The aggregated number of input tokens used.
6670
6671 - `num_model_requests: number`
6672
6673 The count of requests made to the model.
6674
6675 - `object: "organization.usage.moderations.result"`
6676
6677 - `"organization.usage.moderations.result"`
6678
6679 - `api_key_id: optional string`
6680
6681 When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
6682
6683 - `model: optional string`
6684
6685 When `group_by=model`, this field provides the model name of the grouped usage result.
6686
6687 - `project_id: optional string`
6688
6689 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6690
6691 - `user_id: optional string`
6692
6693 When `group_by=user_id`, this field provides the user ID of the grouped usage result.
6694
6695 - `UsageImagesResult object { images, num_model_requests, object, 6 more }`
6696
6697 The aggregated images usage details of the specific time bucket.
6698
6699 - `images: number`
6700
6701 The number of images processed.
6702
6703 - `num_model_requests: number`
6704
6705 The count of requests made to the model.
6706
6707 - `object: "organization.usage.images.result"`
6708
6709 - `"organization.usage.images.result"`
6710
6711 - `api_key_id: optional string`
6712
6713 When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
6714
6715 - `model: optional string`
6716
6717 When `group_by=model`, this field provides the model name of the grouped usage result.
6718
6719 - `project_id: optional string`
6720
6721 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6722
6723 - `size: optional string`
6724
6725 When `group_by=size`, this field provides the image size of the grouped usage result.
6726
6727 - `source: optional string`
6728
6729 When `group_by=source`, this field provides the source of the grouped usage result, possible values are `image.generation`, `image.edit`, `image.variation`.
6730
6731 - `user_id: optional string`
6732
6733 When `group_by=user_id`, this field provides the user ID of the grouped usage result.
6734
6735 - `UsageAudioSpeechesResult object { characters, num_model_requests, object, 4 more }`
6736
6737 The aggregated audio speeches usage details of the specific time bucket.
6738
6739 - `characters: number`
6740
6741 The number of characters processed.
6742
6743 - `num_model_requests: number`
6744
6745 The count of requests made to the model.
6746
6747 - `object: "organization.usage.audio_speeches.result"`
6748
6749 - `"organization.usage.audio_speeches.result"`
6750
6751 - `api_key_id: optional string`
6752
6753 When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
6754
6755 - `model: optional string`
6756
6757 When `group_by=model`, this field provides the model name of the grouped usage result.
6758
6759 - `project_id: optional string`
6760
6761 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6762
6763 - `user_id: optional string`
6764
6765 When `group_by=user_id`, this field provides the user ID of the grouped usage result.
6766
6767 - `UsageAudioTranscriptionsResult object { num_model_requests, object, seconds, 4 more }`
6768
6769 The aggregated audio transcriptions usage details of the specific time bucket.
6770
6771 - `num_model_requests: number`
6772
6773 The count of requests made to the model.
6774
6775 - `object: "organization.usage.audio_transcriptions.result"`
6776
6777 - `"organization.usage.audio_transcriptions.result"`
6778
6779 - `seconds: number`
6780
6781 The number of seconds processed.
6782
6783 - `api_key_id: optional string`
6784
6785 When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
6786
6787 - `model: optional string`
6788
6789 When `group_by=model`, this field provides the model name of the grouped usage result.
6790
6791 - `project_id: optional string`
6792
6793 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6794
6795 - `user_id: optional string`
6796
6797 When `group_by=user_id`, this field provides the user ID of the grouped usage result.
6798
6799 - `UsageVectorStoresResult object { object, usage_bytes, project_id }`
6800
6801 The aggregated vector stores usage details of the specific time bucket.
6802
6803 - `object: "organization.usage.vector_stores.result"`
6804
6805 - `"organization.usage.vector_stores.result"`
6806
6807 - `usage_bytes: number`
6808
6809 The vector stores usage in bytes.
6810
6811 - `project_id: optional string`
6812
6813 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6814
6815 - `UsageCodeInterpreterSessionsResult object { object, num_sessions, project_id }`
6816
6817 The aggregated code interpreter sessions usage details of the specific time bucket.
6818
6819 - `object: "organization.usage.code_interpreter_sessions.result"`
6820
6821 - `"organization.usage.code_interpreter_sessions.result"`
6822
6823 - `num_sessions: optional number`
6824
6825 The number of code interpreter sessions.
6826
6827 - `project_id: optional string`
6828
6829 When `group_by=project_id`, this field provides the project ID of the grouped usage result.
6830
6831 - `CostsResult object { object, amount, api_key_id, 2 more }`
6832
6833 The aggregated costs details of the specific time bucket.
6834
6835 - `object: "organization.costs.result"`
6836
6837 - `"organization.costs.result"`
6838
6839 - `amount: optional object { currency, value }`
6840
6841 The monetary value in its associated currency.
6842
6843 - `currency: optional string`
6844
6845 Lowercase ISO-4217 currency e.g. "usd"
6846
6847 - `value: optional number`
6848
6849 The numeric value of the cost.
6850
6851 - `api_key_id: optional string`
6852
6853 When `group_by=api_key_id`, this field provides the API Key ID of the grouped costs result.
6854
6043 - `line_item: optional string`6855 - `line_item: optional string`
6044 6856
6045 When `group_by=line_item`, this field provides the line item of the grouped costs result.6857 When `group_by=line_item`, this field provides the line item of the grouped costs result.