Skip to content
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

OpenAPI document missing the security scheme definition #25

Closed
justinyoo opened this issue Mar 10, 2023 · 4 comments
Closed

OpenAPI document missing the security scheme definition #25

justinyoo opened this issue Mar 10, 2023 · 4 comments

Comments

@justinyoo
Copy link

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'
...
@thejamescollins
Copy link
Contributor

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.

@justinyoo
Copy link
Author

@om4james I've created a PR for this issue at #26 which has broader coverage than the other two #10 and #12

@MarianSWA
Copy link

Was about to ask the same thing, good to see someone already thought about it. Can't wait for it to be merged

@logankilpatrick
Copy link
Contributor

Security schema is now fixed, the org ID will take a bit more work but is on my radar! Thanks again for flagging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants