Skip to content

Commit

Permalink
feat: Updated OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 6, 2024
1 parent 629acfc commit 5b0429b
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ public sealed partial class UsageCompletionsResult
public global::OpenAI.UsageCompletionsResultObject Object { get; set; }

/// <summary>
/// The number of input tokens used.
/// The aggregated number of input tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("input_tokens")]
[global::System.Text.Json.Serialization.JsonRequired]
public required int InputTokens { get; set; }

/// <summary>
/// The number of input tokens that has been cached from previous requests.
/// The aggregated number of input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("input_cached_tokens")]
public int? InputCachedTokens { get; set; }

/// <summary>
/// The number of output tokens used.
/// The aggregated number of output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("output_tokens")]
[global::System.Text.Json.Serialization.JsonRequired]
Expand Down Expand Up @@ -83,13 +83,13 @@ public sealed partial class UsageCompletionsResult
/// </summary>
/// <param name="object"></param>
/// <param name="inputTokens">
/// The number of input tokens used.
/// The aggregated number of input tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
/// </param>
/// <param name="inputCachedTokens">
/// The number of input tokens that has been cached from previous requests.
/// The aggregated number of input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens.
/// </param>
/// <param name="outputTokens">
/// The number of output tokens used.
/// The aggregated number of output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
/// </param>
/// <param name="numModelRequests">
/// The count of requests made to the model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public sealed partial class UsageEmbeddingsResult
public global::OpenAI.UsageEmbeddingsResultObject Object { get; set; }

/// <summary>
/// The number of input tokens used.
/// The aggregated number of input tokens used.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("input_tokens")]
[global::System.Text.Json.Serialization.JsonRequired]
Expand Down Expand Up @@ -64,7 +64,7 @@ public sealed partial class UsageEmbeddingsResult
/// </summary>
/// <param name="object"></param>
/// <param name="inputTokens">
/// The number of input tokens used.
/// The aggregated number of input tokens used.
/// </param>
/// <param name="numModelRequests">
/// The count of requests made to the model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public sealed partial class UsageModerationsResult
public global::OpenAI.UsageModerationsResultObject Object { get; set; }

/// <summary>
/// The number of input tokens used.
/// The aggregated number of input tokens used.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("input_tokens")]
[global::System.Text.Json.Serialization.JsonRequired]
Expand Down Expand Up @@ -64,7 +64,7 @@ public sealed partial class UsageModerationsResult
/// </summary>
/// <param name="object"></param>
/// <param name="inputTokens">
/// The number of input tokens used.
/// The aggregated number of input tokens used.
/// </param>
/// <param name="numModelRequests">
/// The count of requests made to the model.
Expand Down
43 changes: 37 additions & 6 deletions src/libs/OpenAI/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2290,7 +2290,7 @@ paths:
examples:
request:
curl: "curl \"https://api.openai.com/v1/organization/usage/audio_speeches?start_time=1730419200&limit=1\" \\\n-H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n-H \"Content-Type: application/json\"\n"
response: "{\n \"object\": \"page\",\n \"data\": [\n {\n \"object\": \"bucket\",\n \"start_time\": 1730419200,\n \"end_time\": 1730505600,\n \"results\": [\n {\n \"object\": \"orgainzation.usage.audio_speeches.result\",\n \"characters\": 45,\n \"num_model_requests\": 1,\n \"project_id\": null,\n \"user_id\": null,\n \"api_key_id\": null,\n \"model\": null\n }\n ]\n }\n ],\n \"has_more\": false,\n \"next_page\": null\n}\n"
response: "{\n \"object\": \"page\",\n \"data\": [\n {\n \"object\": \"bucket\",\n \"start_time\": 1730419200,\n \"end_time\": 1730505600,\n \"results\": [\n {\n \"object\": \"organization.usage.audio_speeches.result\",\n \"characters\": 45,\n \"num_model_requests\": 1,\n \"project_id\": null,\n \"user_id\": null,\n \"api_key_id\": null,\n \"model\": null\n }\n ]\n }\n ],\n \"has_more\": false,\n \"next_page\": null\n}\n"
/organization/usage/audio_transcriptions:
get:
tags:
Expand Down Expand Up @@ -5973,9 +5973,11 @@ components:
line_item:
type: string
description: 'When `group_by=line_item`, this field provides the line item of the grouped costs result.'
nullable: true
project_id:
type: string
description: 'When `group_by=project_id`, this field provides the project ID of the grouped costs result.'
nullable: true
description: The aggregated costs details of the specific time bucket.
x-oaiMeta:
name: Costs object
Expand Down Expand Up @@ -13373,15 +13375,19 @@ components:
project_id:
type: string
description: 'When `group_by=project_id`, this field provides the project ID of the grouped usage result.'
nullable: true
user_id:
type: string
description: 'When `group_by=user_id`, this field provides the user ID of the grouped usage result.'
nullable: true
api_key_id:
type: string
description: 'When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.'
nullable: true
model:
type: string
description: 'When `group_by=model`, this field provides the model name of the grouped usage result.'
nullable: true
description: The aggregated audio speeches usage details of the specific time bucket.
x-oaiMeta:
name: Audio speeches usage object
Expand All @@ -13406,15 +13412,19 @@ components:
project_id:
type: string
description: 'When `group_by=project_id`, this field provides the project ID of the grouped usage result.'
nullable: true
user_id:
type: string
description: 'When `group_by=user_id`, this field provides the user ID of the grouped usage result.'
nullable: true
api_key_id:
type: string
description: 'When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.'
nullable: true
model:
type: string
description: 'When `group_by=model`, this field provides the model name of the grouped usage result.'
nullable: true
description: The aggregated audio transcriptions usage details of the specific time bucket.
x-oaiMeta:
name: Audio transcriptions usage object
Expand All @@ -13435,6 +13445,7 @@ components:
project_id:
type: string
description: 'When `group_by=project_id`, this field provides the project ID of the grouped usage result.'
nullable: true
description: The aggregated code interpreter sessions usage details of the specific time bucket.
x-oaiMeta:
name: Code interpreter sessions usage object
Expand All @@ -13453,31 +13464,36 @@ components:
type: string
input_tokens:
type: integer
description: The number of input tokens used.
description: 'The aggregated number of input tokens used. For customers subscribe to scale tier, this includes scale tier tokens.'
input_cached_tokens:
type: integer
description: The number of input tokens that has been cached from previous requests.
description: 'The aggregated number of input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens.'
output_tokens:
type: integer
description: The number of output tokens used.
description: 'The aggregated number of output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.'
num_model_requests:
type: integer
description: The count of requests made to the model.
project_id:
type: string
description: 'When `group_by=project_id`, this field provides the project ID of the grouped usage result.'
nullable: true
user_id:
type: string
description: 'When `group_by=user_id`, this field provides the user ID of the grouped usage result.'
nullable: true
api_key_id:
type: string
description: 'When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.'
nullable: true
model:
type: string
description: 'When `group_by=model`, this field provides the model name of the grouped usage result.'
nullable: true
batch:
type: boolean
description: 'When `group_by=batch`, this field tells whether the grouped usage result is batch or not.'
nullable: true
description: The aggregated completions usage details of the specific time bucket.
x-oaiMeta:
name: Completions usage object
Expand All @@ -13495,22 +13511,26 @@ components:
type: string
input_tokens:
type: integer
description: The number of input tokens used.
description: The aggregated number of input tokens used.
num_model_requests:
type: integer
description: The count of requests made to the model.
project_id:
type: string
description: 'When `group_by=project_id`, this field provides the project ID of the grouped usage result.'
nullable: true
user_id:
type: string
description: 'When `group_by=user_id`, this field provides the user ID of the grouped usage result.'
nullable: true
api_key_id:
type: string
description: 'When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.'
nullable: true
model:
type: string
description: 'When `group_by=model`, this field provides the model name of the grouped usage result.'
nullable: true
description: The aggregated embeddings usage details of the specific time bucket.
x-oaiMeta:
name: Embeddings usage object
Expand All @@ -13535,21 +13555,27 @@ components:
source:
type: string
description: 'When `group_by=source`, this field provides the source of the grouped usage result, possible values are `image.generation`, `image.edit`, `image.variation`.'
nullable: true
size:
type: string
description: 'When `group_by=size`, this field provides the image size of the grouped usage result.'
nullable: true
project_id:
type: string
description: 'When `group_by=project_id`, this field provides the project ID of the grouped usage result.'
nullable: true
user_id:
type: string
description: 'When `group_by=user_id`, this field provides the user ID of the grouped usage result.'
nullable: true
api_key_id:
type: string
description: 'When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.'
nullable: true
model:
type: string
description: 'When `group_by=model`, this field provides the model name of the grouped usage result.'
nullable: true
description: The aggregated images usage details of the specific time bucket.
x-oaiMeta:
name: Images usage object
Expand All @@ -13567,22 +13593,26 @@ components:
type: string
input_tokens:
type: integer
description: The number of input tokens used.
description: The aggregated number of input tokens used.
num_model_requests:
type: integer
description: The count of requests made to the model.
project_id:
type: string
description: 'When `group_by=project_id`, this field provides the project ID of the grouped usage result.'
nullable: true
user_id:
type: string
description: 'When `group_by=user_id`, this field provides the user ID of the grouped usage result.'
nullable: true
api_key_id:
type: string
description: 'When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.'
nullable: true
model:
type: string
description: 'When `group_by=model`, this field provides the model name of the grouped usage result.'
nullable: true
description: The aggregated moderations usage details of the specific time bucket.
x-oaiMeta:
name: Moderations usage object
Expand Down Expand Up @@ -13652,6 +13682,7 @@ components:
project_id:
type: string
description: 'When `group_by=project_id`, this field provides the project ID of the grouped usage result.'
nullable: true
description: The aggregated vector stores usage details of the specific time bucket.
x-oaiMeta:
name: Vector stores usage object
Expand Down

0 comments on commit 5b0429b

Please sign in to comment.