Get the list of models that the current token (API Key) can access. If the token has no model restrictions, all enabled system models are returned.The currently supported public endpoint is:
GET /v1/models
GET /api/token/models is not a currently exposed public endpoint. Use /v1/models instead.
from openai import OpenAIclient = OpenAI( api_key="sk-xxx", base_url="https://crazyrouter.com/v1")# Get model list via OpenAI SDKmodels = client.models.list()for model in models.data: print(model.id)
If you use the OpenAI SDK, client.models.list() is effectively calling GET /v1/models.