openai-api

How do you get the context window of Open AI models?


Is there a specific API call to get the context window of each model open ai offers? I have printed out openai.Models.list() and there isn't any context window member in the json spit out.


Solution

  • That information would probably best fit in the OpenAI API endpoint:

    GET https://api.openai.com/v1/models

    But the API reference shows it doesn't currently return the model's context window :(

    Seems like the best available "source of truth" for this information is the Models page in the documentation.