OpenAPI document missing the security scheme definition
According to the Authorization section of the API document, to make an API call it requires one mandatory Authorization header and an optional OpenAI-Organization header.
As both are missing in the OpenAPI document, they need to be added. Here are examples:
...
paths:
...
/models:
get:
operationId: listModels
tags:
- OpenAI
summary: Lists the currently available models, and provides basic information about each one such as the owner and availability.
# add optional header parameter like below
parameters:
- in: header
name: OpenAI-Organization
required: false
schema:
type: string
example:
org-hP479gBqdEuqjgkVyFPZ5g5h
description: For users who belong to multiple organizations, you can pass a header to specify which organization is used for an API request. Usage from these API requests will count against the specified organization's subscription quota.
...
# global authorization
security:
- api_key: []
components:
# authorization scheme
securitySchemes:
api_key:
type: 'http'
scheme: 'bearer'
bearerFormat: 'Bearer'
...
Thanks @justinyoo, I would also like to see these two things added.
#12 partially solves this (Adds the AuthorizationsecurityScheme).
Adding the OpenAI-Organization Header Parameter to all endpoints would also be great.
@om4james I've created a PR for this issue at #26 which has broader coverage than the other two #10 and #12
Was about to ask the same thing, good to see someone already thought about it. Can't wait for it to be merged
Security schema is now fixed, the org ID will take a bit more work but is on my radar! Thanks again for flagging.