-
Notifications
You must be signed in to change notification settings - Fork 3
docs(openapi): align GET /models examples and parameter semantics #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5012,31 +5012,31 @@ paths: | |
| - in: query | ||
| name: ai_service | ||
| required: false | ||
| description: Filter models by the AI service (e.g., 'openai', 'anthropic'). | ||
| description: Filter models by AI service (e.g., 'openai', 'anthropic'). | ||
| schema: | ||
| type: string | ||
| - in: query | ||
| name: provider | ||
| required: false | ||
| description: Filter models by the provider. | ||
| description: Filter models by virtual key slug (the provider segment in model id `@provider/model`). | ||
| schema: | ||
| type: string | ||
| - in: query | ||
| name: limit | ||
| required: false | ||
| description: The maximum number of models to return. | ||
| description: Maximum number of models to return per page. | ||
| schema: | ||
| type: integer | ||
| - in: query | ||
| name: offset | ||
| required: false | ||
| description: The number of models to skip before starting to collect the result set. | ||
| description: Number of models to skip before collecting the result set. | ||
| schema: | ||
| type: integer | ||
| - in: query | ||
| name: sort | ||
| required: false | ||
| description: The field to sort the results by. | ||
| description: The field to sort the results by (`provider` sorts by virtual key slug). | ||
| schema: | ||
| type: string | ||
| enum: [name, provider, ai_service] | ||
|
|
@@ -5071,13 +5071,13 @@ paths: | |
| label: Default | ||
| source: | | ||
| # Example of sending a query parameter in the URL | ||
| curl 'https://api.portkey.ai/v1/models?provider=openai' \ | ||
| curl 'https://api.portkey.ai/v1/models?ai_service=openai' \ | ||
| -H "x-portkey-api-key: $PORTKEY_API_KEY" | ||
| - lang: curl | ||
| label: Self-Hosted | ||
| source: | | ||
| # Example of sending a query parameter in the URL | ||
| curl 'https://YOUR_SELF_HOSTED_URL/models?provider=openai' \ | ||
| curl 'https://YOUR_SELF_HOSTED_URL/models?ai_service=openai' \ | ||
| -H "x-portkey-api-key: $PORTKEY_API_KEY" | ||
|
Comment on lines
5077
to
5081
|
||
| - lang: python | ||
| label: Default | ||
|
|
@@ -5090,7 +5090,7 @@ paths: | |
|
|
||
| # Example of sending query parameters via extra_query | ||
| models = client.models.list( | ||
| extra_query={"provider": "openai"} | ||
| extra_query={"ai_service": "openai"} | ||
| ) | ||
| print(models) | ||
| - lang: python | ||
|
|
@@ -5105,7 +5105,7 @@ paths: | |
|
|
||
| # Example of sending query parameters via extra_query | ||
| models = client.models.list( | ||
| extra_query={"provider": "openai"} | ||
| extra_query={"ai_service": "openai"} | ||
| ) | ||
| print(models) | ||
| - lang: javascript | ||
|
|
@@ -5120,7 +5120,7 @@ paths: | |
| async function main() { | ||
| // Example of sending query parameters in the list method | ||
| const list = await client.models.list({ | ||
| provider: "openai" | ||
| ai_service: "openai" | ||
| }); | ||
| console.log(list); | ||
| } | ||
|
|
@@ -5138,7 +5138,7 @@ paths: | |
| async function main() { | ||
| // Example of sending query parameters in the list method | ||
| const list = await client.models.list({ | ||
| provider: "openai" | ||
| ai_service: "openai" | ||
| }); | ||
| console.log(list); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor consistency: this description uses single quotes around example values ('openai', 'anthropic'), but most other parameter descriptions in this spec either omit quotes or use backticks for inline code (e.g., "AI provider organization (e.g., openai, anthropic)" at openapi.yaml:33920). Consider aligning the formatting to match the rest of the document.