openai 0.98.0 → 0.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/README.md +1 -1
- data/bedrock.md +17 -1
- data/lib/openai/client.rb +9 -0
- data/lib/openai/helpers/agents/session_stream.rb +11 -36
- data/lib/openai/helpers/agents/tools.rb +34 -4
- data/lib/openai/helpers/beta/agents/creation_stream.rb +26 -0
- data/lib/openai/helpers/beta/agents/function_tool.rb +11 -4
- data/lib/openai/helpers/beta/agents/tool_dispatcher.rb +74 -0
- data/lib/openai/helpers/beta/agents/tool_error.rb +28 -0
- data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_completions_params.rb +9 -4
- data/lib/openai/models/admin/organization/usage_completions_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_costs_params.rb +16 -4
- data/lib/openai/models/admin/organization/usage_costs_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_embeddings_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_images_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_moderations_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_web_search_calls_params.rb +9 -4
- data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +140 -5
- data/lib/openai/models/all_models.rb +42 -0
- data/lib/openai/models/audio/speech_create_params.rb +6 -0
- data/lib/openai/models/audio/voice.rb +75 -0
- data/lib/openai/models/audio/voice_create_params.rb +217 -0
- data/lib/openai/models/beta/agent_create_params.rb +0 -3
- data/lib/openai/models/beta/agent_update_params.rb +0 -3
- data/lib/openai/models/beta/agents/environments/template_create_params.rb +6 -6
- data/lib/openai/models/beta/agents/environments/template_update_params.rb +3 -6
- data/lib/openai/models/beta/agents/session_create_params.rb +0 -3
- data/lib/openai/models/beta/agents/session_update_params.rb +0 -3
- data/lib/openai/models/beta/agents/sessions/turns/item_list_params.rb +79 -0
- data/lib/openai/models/beta/beta_response.rb +220 -0
- data/lib/openai/models/beta/beta_response_computer_tool_call_output_item.rb +2 -2
- data/lib/openai/models/beta/beta_response_error.rb +12 -1
- data/lib/openai/models/beta/beta_responses_client_event.rb +220 -0
- data/lib/openai/models/beta/beta_responses_server_event.rb +12 -1
- data/lib/openai/models/beta/beta_tool.rb +15 -18
- data/lib/openai/models/beta/environment_param.rb +6 -6
- data/lib/openai/models/beta/response_compact_params.rb +220 -0
- data/lib/openai/models/beta/response_create_params.rb +220 -0
- data/lib/openai/models/beta/session_turn_error.rb +9 -0
- data/lib/openai/models/chat/chat_completion_audio_param.rb +6 -3
- data/lib/openai/models/chat/chat_completion_chunk.rb +85 -18
- data/lib/openai/models/chat_model.rb +178 -0
- data/lib/openai/models/error_object.rb +12 -1
- data/lib/openai/models/eval_create_params.rb +1 -1
- data/lib/openai/models/eval_create_response.rb +1 -1
- data/lib/openai/models/eval_list_response.rb +1 -1
- data/lib/openai/models/eval_retrieve_response.rb +1 -1
- data/lib/openai/models/eval_update_response.rb +1 -1
- data/lib/openai/models/fine_tuning/job_list_params.rb +14 -4
- data/lib/openai/models/graders/score_model_grader.rb +2 -2
- data/lib/openai/models/image.rb +14 -14
- data/lib/openai/models/image_create_variation_params.rb +7 -7
- data/lib/openai/models/image_edit_params.rb +88 -96
- data/lib/openai/models/image_generate_params.rb +51 -62
- data/lib/openai/models/image_model.rb +5 -3
- data/lib/openai/models/realtime/realtime_audio_config_output.rb +9 -6
- data/lib/openai/models/realtime/realtime_client_event.rb +9 -0
- data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +9 -6
- data/lib/openai/models/realtime/session_update_event.rb +16 -0
- data/lib/openai/models/responses/response_compact_params.rb +220 -0
- data/lib/openai/models/responses/response_computer_tool_call_output_item.rb +2 -2
- data/lib/openai/models/responses/response_error.rb +12 -1
- data/lib/openai/models/responses/responses_server_event.rb +12 -1
- data/lib/openai/models/responses/tool.rb +15 -18
- data/lib/openai/models/responses_model.rb +42 -0
- data/lib/openai/models/video_create_error.rb +12 -1
- data/lib/openai/models/webhooks/agent_session_action_required_webhook_event.rb +109 -0
- data/lib/openai/models/webhooks/agent_session_created_webhook_event.rb +106 -0
- data/lib/openai/models/webhooks/agent_session_failed_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/agent_session_idle_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/agent_session_in_progress_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +18 -2
- data/lib/openai/models/webhooks/webhook_create_params.rb +5 -0
- data/lib/openai/models/webhooks/webhook_test_params.rb +5 -0
- data/lib/openai/models/webhooks/webhook_update_params.rb +5 -0
- data/lib/openai/providers/bedrock.rb +20 -1
- data/lib/openai/resources/admin/organization/usage.rb +15 -6
- data/lib/openai/resources/audio/speech.rb +2 -0
- data/lib/openai/resources/audio/voices.rb +53 -0
- data/lib/openai/resources/audio.rb +5 -0
- data/lib/openai/resources/beta/agents/environments/templates.rb +3 -4
- data/lib/openai/resources/beta/agents/sessions/turns/items.rb +68 -0
- data/lib/openai/resources/beta/agents/sessions/turns.rb +4 -0
- data/lib/openai/resources/beta/agents/sessions.rb +22 -2
- data/lib/openai/resources/fine_tuning/jobs.rb +7 -2
- data/lib/openai/resources/images.rb +79 -109
- data/lib/openai/resources/webhooks.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +10 -0
- data/rbi/openai/helpers/agents.rbi +2 -0
- data/rbi/openai/helpers/beta/agents/function_tool.rbi +8 -3
- data/rbi/openai/helpers/beta/agents/tool_error.rbi +19 -0
- data/rbi/openai/helpers/beta/agents.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_completions_params.rbi +9 -4
- data/rbi/openai/models/admin/organization/usage_completions_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_costs_params.rbi +16 -4
- data/rbi/openai/models/admin/organization/usage_costs_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_images_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_web_search_calls_params.rbi +12 -4
- data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +213 -3
- data/rbi/openai/models/audio/speech_create_params.rbi +6 -0
- data/rbi/openai/models/audio/voice.rbi +111 -0
- data/rbi/openai/models/audio/voice_create_params.rbi +321 -0
- data/rbi/openai/models/beta/agent_create_params.rbi +0 -3
- data/rbi/openai/models/beta/agent_update_params.rbi +0 -3
- data/rbi/openai/models/beta/agents/environments/template_create_params.rbi +6 -6
- data/rbi/openai/models/beta/agents/environments/template_update_params.rbi +3 -6
- data/rbi/openai/models/beta/agents/session_create_params.rbi +0 -3
- data/rbi/openai/models/beta/agents/session_update_params.rbi +0 -3
- data/rbi/openai/models/beta/agents/sessions/turns/item_list_params.rbi +139 -0
- data/rbi/openai/models/beta/beta_response_computer_tool_call_output_item.rbi +2 -2
- data/rbi/openai/models/beta/beta_response_error.rbi +12 -0
- data/rbi/openai/models/beta/beta_responses_server_event.rbi +12 -0
- data/rbi/openai/models/beta/beta_tool.rbi +15 -18
- data/rbi/openai/models/beta/environment_param.rbi +6 -6
- data/rbi/openai/models/beta/session_turn_error.rbi +18 -0
- data/rbi/openai/models/chat/chat_completion_audio_param.rbi +6 -3
- data/rbi/openai/models/chat/chat_completion_chunk.rbi +123 -17
- data/rbi/openai/models/error_object.rbi +12 -0
- data/rbi/openai/models/eval_create_params.rbi +1 -1
- data/rbi/openai/models/eval_create_response.rbi +1 -1
- data/rbi/openai/models/eval_list_response.rbi +1 -1
- data/rbi/openai/models/eval_retrieve_response.rbi +1 -1
- data/rbi/openai/models/eval_update_response.rbi +1 -1
- data/rbi/openai/models/fine_tuning/job_list_params.rbi +14 -4
- data/rbi/openai/models/graders/score_model_grader.rbi +2 -2
- data/rbi/openai/models/image.rbi +14 -14
- data/rbi/openai/models/image_create_variation_params.rbi +6 -6
- data/rbi/openai/models/image_edit_params.rbi +73 -91
- data/rbi/openai/models/image_generate_params.rbi +30 -61
- data/rbi/openai/models/image_model.rbi +3 -3
- data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +9 -6
- data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +9 -6
- data/rbi/openai/models/realtime/session_update_event.rbi +16 -0
- data/rbi/openai/models/responses/response_computer_tool_call_output_item.rbi +2 -2
- data/rbi/openai/models/responses/response_error.rbi +12 -0
- data/rbi/openai/models/responses/responses_server_event.rbi +12 -0
- data/rbi/openai/models/responses/tool.rbi +15 -18
- data/rbi/openai/models/video_create_error.rbi +12 -0
- data/rbi/openai/models/webhooks/agent_session_action_required_webhook_event.rbi +222 -0
- data/rbi/openai/models/webhooks/agent_session_created_webhook_event.rbi +202 -0
- data/rbi/openai/models/webhooks/agent_session_failed_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/agent_session_idle_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/agent_session_in_progress_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +7 -1
- data/rbi/openai/models/webhooks/webhook_create_params.rbi +20 -0
- data/rbi/openai/models/webhooks/webhook_test_params.rbi +20 -0
- data/rbi/openai/models/webhooks/webhook_update_params.rbi +20 -0
- data/rbi/openai/resources/admin/organization/usage.rbi +15 -6
- data/rbi/openai/resources/audio/speech.rbi +2 -0
- data/rbi/openai/resources/audio/voices.rbi +49 -0
- data/rbi/openai/resources/audio.rbi +4 -0
- data/rbi/openai/resources/beta/agents/environments/templates.rbi +3 -4
- data/rbi/openai/resources/beta/agents/sessions/turns/items.rbi +62 -0
- data/rbi/openai/resources/beta/agents/sessions/turns.rbi +3 -0
- data/rbi/openai/resources/beta/agents/sessions.rbi +2 -0
- data/rbi/openai/resources/fine_tuning/jobs.rbi +7 -2
- data/rbi/openai/resources/images.rbi +77 -109
- data/rbi/openai/resources/webhooks.rbi +5 -0
- data/sig/openai/helpers/agents.rbs +3 -0
- data/sig/openai/helpers/beta/agents/function_tool.rbs +5 -2
- data/sig/openai/helpers/beta/agents/tool_error.rbs +17 -0
- data/sig/openai/helpers/beta/agents.rbs +5 -0
- data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_completions_params.rbs +14 -6
- data/sig/openai/models/admin/organization/usage_completions_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_costs_params.rbs +25 -7
- data/sig/openai/models/admin/organization/usage_costs_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_images_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_moderations_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_web_search_calls_params.rbs +19 -7
- data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +107 -5
- data/sig/openai/models/audio/speech_create_params.rbs +4 -0
- data/sig/openai/models/audio/voice.rbs +70 -0
- data/sig/openai/models/audio/voice_create_params.rbs +203 -0
- data/sig/openai/models/beta/agent_create_params.rbs +1 -5
- data/sig/openai/models/beta/agent_update_params.rbs +1 -5
- data/sig/openai/models/beta/agents/environments/template_create_params.rbs +4 -4
- data/sig/openai/models/beta/agents/environments/template_update_params.rbs +2 -4
- data/sig/openai/models/beta/agents/session_create_params.rbs +1 -5
- data/sig/openai/models/beta/agents/session_update_params.rbs +1 -5
- data/sig/openai/models/beta/agents/sessions/turns/item_list_params.rbs +91 -0
- data/sig/openai/models/beta/beta_response_computer_tool_call_output_item.rbs +2 -2
- data/sig/openai/models/beta/beta_response_error.rbs +10 -0
- data/sig/openai/models/beta/beta_responses_server_event.rbs +10 -0
- data/sig/openai/models/beta/beta_tool.rbs +11 -15
- data/sig/openai/models/beta/environment_param.rbs +4 -4
- data/sig/openai/models/beta/session_turn_error.rbs +12 -0
- data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -2
- data/sig/openai/models/chat/chat_completion_chunk.rbs +96 -12
- data/sig/openai/models/error_object.rbs +10 -0
- data/sig/openai/models/eval_create_params.rbs +1 -1
- data/sig/openai/models/eval_create_response.rbs +1 -1
- data/sig/openai/models/eval_list_response.rbs +1 -1
- data/sig/openai/models/eval_retrieve_response.rbs +1 -1
- data/sig/openai/models/eval_update_response.rbs +1 -1
- data/sig/openai/models/fine_tuning/job_list_params.rbs +14 -4
- data/sig/openai/models/graders/score_model_grader.rbs +3 -3
- data/sig/openai/models/image.rbs +21 -21
- data/sig/openai/models/image_create_variation_params.rbs +4 -4
- data/sig/openai/models/image_edit_params.rbs +54 -66
- data/sig/openai/models/image_generate_params.rbs +23 -45
- data/sig/openai/models/image_model.rbs +6 -6
- data/sig/openai/models/realtime/realtime_audio_config_output.rbs +9 -6
- data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +9 -6
- data/sig/openai/models/responses/response_computer_tool_call_output_item.rbs +2 -2
- data/sig/openai/models/responses/response_error.rbs +10 -0
- data/sig/openai/models/responses/responses_server_event.rbs +10 -0
- data/sig/openai/models/responses/tool.rbs +11 -15
- data/sig/openai/models/video_create_error.rbs +10 -0
- data/sig/openai/models/webhooks/agent_session_action_required_webhook_event.rbs +114 -0
- data/sig/openai/models/webhooks/agent_session_created_webhook_event.rbs +115 -0
- data/sig/openai/models/webhooks/agent_session_failed_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/agent_session_idle_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/agent_session_in_progress_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +6 -1
- data/sig/openai/models/webhooks/webhook_create_params.rbs +10 -0
- data/sig/openai/models/webhooks/webhook_test_params.rbs +10 -0
- data/sig/openai/models/webhooks/webhook_update_params.rbs +10 -0
- data/sig/openai/resources/audio/voices.rbs +14 -0
- data/sig/openai/resources/audio.rbs +2 -0
- data/sig/openai/resources/beta/agents/sessions/turns/items.rbs +24 -0
- data/sig/openai/resources/beta/agents/sessions/turns.rbs +2 -0
- data/sig/openai/resources/beta/agents/sessions.rbs +1 -0
- data/sig/openai/resources/webhooks.rbs +6 -1
- metadata +35 -1
|
@@ -194,6 +194,19 @@ module OpenAI
|
|
|
194
194
|
sig { returns(T.nilable(String)) }
|
|
195
195
|
attr_accessor :api_key_id
|
|
196
196
|
|
|
197
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
198
|
+
# activity and `unlabeled` includes all records without published source
|
|
199
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
200
|
+
# direct API usage. Without source grouping, this field is null.
|
|
201
|
+
sig {
|
|
202
|
+
returns(
|
|
203
|
+
T.nilable(
|
|
204
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
205
|
+
)
|
|
206
|
+
)
|
|
207
|
+
}
|
|
208
|
+
attr_accessor :api_source
|
|
209
|
+
|
|
197
210
|
# When `group_by=batch`, this field tells whether the grouped usage result is
|
|
198
211
|
# batch or not.
|
|
199
212
|
sig { returns(T.nilable(T::Boolean)) }
|
|
@@ -206,7 +219,16 @@ module OpenAI
|
|
|
206
219
|
sig { params(input_audio_tokens: Integer).void }
|
|
207
220
|
attr_writer :input_audio_tokens
|
|
208
221
|
|
|
209
|
-
# The aggregated number of input tokens written to the cache
|
|
222
|
+
# The aggregated number of input tokens written to the cache with a 12-hour
|
|
223
|
+
# retention period.
|
|
224
|
+
sig { returns(T.nilable(Integer)) }
|
|
225
|
+
attr_reader :input_cache_write_12h_tokens
|
|
226
|
+
|
|
227
|
+
sig { params(input_cache_write_12h_tokens: Integer).void }
|
|
228
|
+
attr_writer :input_cache_write_12h_tokens
|
|
229
|
+
|
|
230
|
+
# The aggregated number of input tokens written to the cache with a 30-minute
|
|
231
|
+
# retention period.
|
|
210
232
|
sig { returns(T.nilable(Integer)) }
|
|
211
233
|
attr_reader :input_cache_write_tokens
|
|
212
234
|
|
|
@@ -318,10 +340,16 @@ module OpenAI
|
|
|
318
340
|
|
|
319
341
|
api_key_id: T.nilable(String),
|
|
320
342
|
|
|
343
|
+
api_source: T.nilable(
|
|
344
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::OrSymbol
|
|
345
|
+
),
|
|
346
|
+
|
|
321
347
|
batch: T.nilable(T::Boolean),
|
|
322
348
|
|
|
323
349
|
input_audio_tokens: Integer,
|
|
324
350
|
|
|
351
|
+
input_cache_write_12h_tokens: Integer,
|
|
352
|
+
|
|
325
353
|
input_cache_write_tokens: Integer,
|
|
326
354
|
|
|
327
355
|
input_cached_audio_tokens: Integer,
|
|
@@ -375,6 +403,12 @@ module OpenAI
|
|
|
375
403
|
# usage result.
|
|
376
404
|
api_key_id: nil,
|
|
377
405
|
|
|
406
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
407
|
+
# activity and `unlabeled` includes all records without published source
|
|
408
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
409
|
+
# direct API usage. Without source grouping, this field is null.
|
|
410
|
+
api_source: nil,
|
|
411
|
+
|
|
378
412
|
# When `group_by=batch`, this field tells whether the grouped usage result is
|
|
379
413
|
# batch or not.
|
|
380
414
|
batch: nil,
|
|
@@ -382,7 +416,12 @@ module OpenAI
|
|
|
382
416
|
# The aggregated number of uncached audio input tokens used.
|
|
383
417
|
input_audio_tokens: nil,
|
|
384
418
|
|
|
385
|
-
# The aggregated number of input tokens written to the cache
|
|
419
|
+
# The aggregated number of input tokens written to the cache with a 12-hour
|
|
420
|
+
# retention period.
|
|
421
|
+
input_cache_write_12h_tokens: nil,
|
|
422
|
+
|
|
423
|
+
# The aggregated number of input tokens written to the cache with a 30-minute
|
|
424
|
+
# retention period.
|
|
386
425
|
input_cache_write_tokens: nil,
|
|
387
426
|
|
|
388
427
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -446,8 +485,12 @@ module OpenAI
|
|
|
446
485
|
object: Symbol,
|
|
447
486
|
output_tokens: Integer,
|
|
448
487
|
api_key_id: T.nilable(String),
|
|
488
|
+
api_source: T.nilable(
|
|
489
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
490
|
+
),
|
|
449
491
|
batch: T.nilable(T::Boolean),
|
|
450
492
|
input_audio_tokens: Integer,
|
|
493
|
+
input_cache_write_12h_tokens: Integer,
|
|
451
494
|
input_cache_write_tokens: Integer,
|
|
452
495
|
input_cached_audio_tokens: Integer,
|
|
453
496
|
input_cached_image_tokens: Integer,
|
|
@@ -469,6 +512,40 @@ module OpenAI
|
|
|
469
512
|
def to_hash
|
|
470
513
|
end
|
|
471
514
|
|
|
515
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
516
|
+
# activity and `unlabeled` includes all records without published source
|
|
517
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
518
|
+
# direct API usage. Without source grouping, this field is null.
|
|
519
|
+
module APISource
|
|
520
|
+
extend OpenAI::Internal::Type::Enum
|
|
521
|
+
|
|
522
|
+
TaggedSymbol = T.type_alias {
|
|
523
|
+
T.all(
|
|
524
|
+
Symbol,
|
|
525
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource
|
|
526
|
+
)
|
|
527
|
+
}
|
|
528
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
529
|
+
|
|
530
|
+
AGENTS_API = T.let(
|
|
531
|
+
:agents_api,
|
|
532
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
533
|
+
)
|
|
534
|
+
UNLABELED = T.let(
|
|
535
|
+
:unlabeled,
|
|
536
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
537
|
+
)
|
|
538
|
+
|
|
539
|
+
sig {
|
|
540
|
+
override.returns(
|
|
541
|
+
T::Array[
|
|
542
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
543
|
+
]
|
|
544
|
+
)
|
|
545
|
+
}
|
|
546
|
+
def self.values
|
|
547
|
+
end
|
|
548
|
+
end
|
|
472
549
|
end
|
|
473
550
|
|
|
474
551
|
class OrganizationUsageEmbeddingsResult < OpenAI::Internal::Type::BaseModel
|
|
@@ -1250,6 +1327,19 @@ module OpenAI
|
|
|
1250
1327
|
sig { returns(T.nilable(String)) }
|
|
1251
1328
|
attr_accessor :api_key_id
|
|
1252
1329
|
|
|
1330
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1331
|
+
# activity and `unlabeled` includes all records without published source
|
|
1332
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1333
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1334
|
+
sig {
|
|
1335
|
+
returns(
|
|
1336
|
+
T.nilable(
|
|
1337
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1338
|
+
)
|
|
1339
|
+
)
|
|
1340
|
+
}
|
|
1341
|
+
attr_accessor :api_source
|
|
1342
|
+
|
|
1253
1343
|
# When `group_by=context_level`, this field provides the search context size of
|
|
1254
1344
|
# the grouped usage result.
|
|
1255
1345
|
sig { returns(T.nilable(String)) }
|
|
@@ -1280,6 +1370,10 @@ module OpenAI
|
|
|
1280
1370
|
|
|
1281
1371
|
api_key_id: T.nilable(String),
|
|
1282
1372
|
|
|
1373
|
+
api_source: T.nilable(
|
|
1374
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::OrSymbol
|
|
1375
|
+
),
|
|
1376
|
+
|
|
1283
1377
|
context_level: T.nilable(String),
|
|
1284
1378
|
|
|
1285
1379
|
model: T.nilable(String),
|
|
@@ -1304,6 +1398,12 @@ module OpenAI
|
|
|
1304
1398
|
# usage result.
|
|
1305
1399
|
api_key_id: nil,
|
|
1306
1400
|
|
|
1401
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1402
|
+
# activity and `unlabeled` includes all records without published source
|
|
1403
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1404
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1405
|
+
api_source: nil,
|
|
1406
|
+
|
|
1307
1407
|
# When `group_by=context_level`, this field provides the search context size of
|
|
1308
1408
|
# the grouped usage result.
|
|
1309
1409
|
context_level: nil,
|
|
@@ -1331,6 +1431,9 @@ module OpenAI
|
|
|
1331
1431
|
num_requests: Integer,
|
|
1332
1432
|
object: Symbol,
|
|
1333
1433
|
api_key_id: T.nilable(String),
|
|
1434
|
+
api_source: T.nilable(
|
|
1435
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1436
|
+
),
|
|
1334
1437
|
context_level: T.nilable(String),
|
|
1335
1438
|
model: T.nilable(String),
|
|
1336
1439
|
project_id: T.nilable(String),
|
|
@@ -1341,6 +1444,40 @@ module OpenAI
|
|
|
1341
1444
|
def to_hash
|
|
1342
1445
|
end
|
|
1343
1446
|
|
|
1447
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1448
|
+
# activity and `unlabeled` includes all records without published source
|
|
1449
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1450
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1451
|
+
module APISource
|
|
1452
|
+
extend OpenAI::Internal::Type::Enum
|
|
1453
|
+
|
|
1454
|
+
TaggedSymbol = T.type_alias {
|
|
1455
|
+
T.all(
|
|
1456
|
+
Symbol,
|
|
1457
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource
|
|
1458
|
+
)
|
|
1459
|
+
}
|
|
1460
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1461
|
+
|
|
1462
|
+
AGENTS_API = T.let(
|
|
1463
|
+
:agents_api,
|
|
1464
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1465
|
+
)
|
|
1466
|
+
UNLABELED = T.let(
|
|
1467
|
+
:unlabeled,
|
|
1468
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1469
|
+
)
|
|
1470
|
+
|
|
1471
|
+
sig {
|
|
1472
|
+
override.returns(
|
|
1473
|
+
T::Array[
|
|
1474
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1475
|
+
]
|
|
1476
|
+
)
|
|
1477
|
+
}
|
|
1478
|
+
def self.values
|
|
1479
|
+
end
|
|
1480
|
+
end
|
|
1344
1481
|
end
|
|
1345
1482
|
|
|
1346
1483
|
class OrganizationCostsResult < OpenAI::Internal::Type::BaseModel
|
|
@@ -1377,6 +1514,19 @@ module OpenAI
|
|
|
1377
1514
|
sig { returns(T.nilable(String)) }
|
|
1378
1515
|
attr_accessor :api_key_id
|
|
1379
1516
|
|
|
1517
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1518
|
+
# activity and `unlabeled` includes all records without published source
|
|
1519
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1520
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1521
|
+
sig {
|
|
1522
|
+
returns(
|
|
1523
|
+
T.nilable(
|
|
1524
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1525
|
+
)
|
|
1526
|
+
)
|
|
1527
|
+
}
|
|
1528
|
+
attr_accessor :api_source
|
|
1529
|
+
|
|
1380
1530
|
# When `group_by=line_item`, this field provides the line item of the grouped
|
|
1381
1531
|
# costs result.
|
|
1382
1532
|
sig { returns(T.nilable(String)) }
|
|
@@ -1397,6 +1547,11 @@ module OpenAI
|
|
|
1397
1547
|
sig { returns(T.nilable(T.any(String, OpenAI::Admin::Organization::CostQuantityUnit::OrSymbol))) }
|
|
1398
1548
|
attr_accessor :quantity_unit
|
|
1399
1549
|
|
|
1550
|
+
# When `group_by=user_id`, this field provides the user ID of the grouped costs
|
|
1551
|
+
# result.
|
|
1552
|
+
sig { returns(T.nilable(String)) }
|
|
1553
|
+
attr_accessor :user_id
|
|
1554
|
+
|
|
1400
1555
|
# The aggregated costs details of the specific time bucket.
|
|
1401
1556
|
sig do
|
|
1402
1557
|
params(
|
|
@@ -1405,6 +1560,10 @@ module OpenAI
|
|
|
1405
1560
|
|
|
1406
1561
|
api_key_id: T.nilable(String),
|
|
1407
1562
|
|
|
1563
|
+
api_source: T.nilable(
|
|
1564
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationCostsResult::APISource::OrSymbol
|
|
1565
|
+
),
|
|
1566
|
+
|
|
1408
1567
|
line_item: T.nilable(String),
|
|
1409
1568
|
|
|
1410
1569
|
project_id: T.nilable(String),
|
|
@@ -1413,6 +1572,8 @@ module OpenAI
|
|
|
1413
1572
|
|
|
1414
1573
|
quantity_unit: T.nilable(T.any(String, OpenAI::Admin::Organization::CostQuantityUnit::OrSymbol)),
|
|
1415
1574
|
|
|
1575
|
+
user_id: T.nilable(String),
|
|
1576
|
+
|
|
1416
1577
|
object: Symbol
|
|
1417
1578
|
)
|
|
1418
1579
|
.returns(T.attached_class)
|
|
@@ -1426,6 +1587,12 @@ module OpenAI
|
|
|
1426
1587
|
# costs result.
|
|
1427
1588
|
api_key_id: nil,
|
|
1428
1589
|
|
|
1590
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1591
|
+
# activity and `unlabeled` includes all records without published source
|
|
1592
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1593
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1594
|
+
api_source: nil,
|
|
1595
|
+
|
|
1429
1596
|
# When `group_by=line_item`, this field provides the line item of the grouped
|
|
1430
1597
|
# costs result.
|
|
1431
1598
|
line_item: nil,
|
|
@@ -1442,6 +1609,10 @@ module OpenAI
|
|
|
1442
1609
|
# result, this field is `null`.
|
|
1443
1610
|
quantity_unit: nil,
|
|
1444
1611
|
|
|
1612
|
+
# When `group_by=user_id`, this field provides the user ID of the grouped costs
|
|
1613
|
+
# result.
|
|
1614
|
+
user_id: nil,
|
|
1615
|
+
|
|
1445
1616
|
object: :"organization.costs.result"
|
|
1446
1617
|
)
|
|
1447
1618
|
end
|
|
@@ -1452,10 +1623,14 @@ module OpenAI
|
|
|
1452
1623
|
object: Symbol,
|
|
1453
1624
|
amount: OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationCostsResult::Amount,
|
|
1454
1625
|
api_key_id: T.nilable(String),
|
|
1626
|
+
api_source: T.nilable(
|
|
1627
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1628
|
+
),
|
|
1455
1629
|
line_item: T.nilable(String),
|
|
1456
1630
|
project_id: T.nilable(String),
|
|
1457
1631
|
quantity: T.nilable(Float),
|
|
1458
|
-
quantity_unit: T.nilable(T.any(String, OpenAI::Admin::Organization::CostQuantityUnit::OrSymbol))
|
|
1632
|
+
quantity_unit: T.nilable(T.any(String, OpenAI::Admin::Organization::CostQuantityUnit::OrSymbol)),
|
|
1633
|
+
user_id: T.nilable(String)
|
|
1459
1634
|
}
|
|
1460
1635
|
)
|
|
1461
1636
|
end
|
|
@@ -1514,6 +1689,41 @@ module OpenAI
|
|
|
1514
1689
|
end
|
|
1515
1690
|
|
|
1516
1691
|
end
|
|
1692
|
+
|
|
1693
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1694
|
+
# activity and `unlabeled` includes all records without published source
|
|
1695
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1696
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1697
|
+
module APISource
|
|
1698
|
+
extend OpenAI::Internal::Type::Enum
|
|
1699
|
+
|
|
1700
|
+
TaggedSymbol = T.type_alias {
|
|
1701
|
+
T.all(
|
|
1702
|
+
Symbol,
|
|
1703
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationCostsResult::APISource
|
|
1704
|
+
)
|
|
1705
|
+
}
|
|
1706
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1707
|
+
|
|
1708
|
+
AGENTS_API = T.let(
|
|
1709
|
+
:agents_api,
|
|
1710
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1711
|
+
)
|
|
1712
|
+
UNLABELED = T.let(
|
|
1713
|
+
:unlabeled,
|
|
1714
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1715
|
+
)
|
|
1716
|
+
|
|
1717
|
+
sig {
|
|
1718
|
+
override.returns(
|
|
1719
|
+
T::Array[
|
|
1720
|
+
OpenAI::Models::Admin::Organization::UsageCompletionsResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1721
|
+
]
|
|
1722
|
+
)
|
|
1723
|
+
}
|
|
1724
|
+
def self.values
|
|
1725
|
+
end
|
|
1726
|
+
end
|
|
1517
1727
|
end
|
|
1518
1728
|
|
|
1519
1729
|
sig {
|
|
@@ -45,8 +45,13 @@ module OpenAI
|
|
|
45
45
|
sig { params(end_time: Integer).void }
|
|
46
46
|
attr_writer :end_time
|
|
47
47
|
|
|
48
|
-
# Group the costs by the specified fields.
|
|
49
|
-
# `line_item`, `api_key_id
|
|
48
|
+
# Group the costs by the specified fields. Supported fields include `project_id`,
|
|
49
|
+
# `user_id`, `line_item`, `api_key_id`, and `api_source`. Support for combining
|
|
50
|
+
# `user_id` with `project_id` grouping or the `project_ids` filter depends on the
|
|
51
|
+
# organization and requested time range. Unsupported combinations return HTTP 400.
|
|
52
|
+
# When grouped by `api_source`, results use `agents_api` for attributed Agents API
|
|
53
|
+
# activity and `unlabeled` for all other activity. Without source grouping,
|
|
54
|
+
# `api_source` is null.
|
|
50
55
|
sig { returns(T.nilable(T::Array[OpenAI::Admin::Organization::UsageCostsParams::GroupBy::OrSymbol])) }
|
|
51
56
|
attr_reader :group_by
|
|
52
57
|
|
|
@@ -124,8 +129,13 @@ module OpenAI
|
|
|
124
129
|
# End time (Unix seconds) of the query time range, exclusive.
|
|
125
130
|
end_time: nil,
|
|
126
131
|
|
|
127
|
-
# Group the costs by the specified fields.
|
|
128
|
-
# `line_item`, `api_key_id
|
|
132
|
+
# Group the costs by the specified fields. Supported fields include `project_id`,
|
|
133
|
+
# `user_id`, `line_item`, `api_key_id`, and `api_source`. Support for combining
|
|
134
|
+
# `user_id` with `project_id` grouping or the `project_ids` filter depends on the
|
|
135
|
+
# organization and requested time range. Unsupported combinations return HTTP 400.
|
|
136
|
+
# When grouped by `api_source`, results use `agents_api` for attributed Agents API
|
|
137
|
+
# activity and `unlabeled` for all other activity. Without source grouping,
|
|
138
|
+
# `api_source` is null.
|
|
129
139
|
group_by: nil,
|
|
130
140
|
|
|
131
141
|
# A limit on the number of buckets to be returned. Limit can range between 1 and
|
|
@@ -190,8 +200,10 @@ module OpenAI
|
|
|
190
200
|
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
191
201
|
|
|
192
202
|
PROJECT_ID = T.let(:project_id, OpenAI::Admin::Organization::UsageCostsParams::GroupBy::TaggedSymbol)
|
|
203
|
+
USER_ID = T.let(:user_id, OpenAI::Admin::Organization::UsageCostsParams::GroupBy::TaggedSymbol)
|
|
193
204
|
LINE_ITEM = T.let(:line_item, OpenAI::Admin::Organization::UsageCostsParams::GroupBy::TaggedSymbol)
|
|
194
205
|
API_KEY_ID = T.let(:api_key_id, OpenAI::Admin::Organization::UsageCostsParams::GroupBy::TaggedSymbol)
|
|
206
|
+
API_SOURCE = T.let(:api_source, OpenAI::Admin::Organization::UsageCostsParams::GroupBy::TaggedSymbol)
|
|
195
207
|
|
|
196
208
|
sig { override.returns(T::Array[OpenAI::Admin::Organization::UsageCostsParams::GroupBy::TaggedSymbol]) }
|
|
197
209
|
def self.values
|