Skip to content

Add an OpenAI-Compatible Models Endpoint #5

@aafre

Description

@aafre

The official OpenAI API has an endpoint at /v1/models to list available models. Our current /models endpoint is a native one.

To improve compatibility, we should add the official /v1/models endpoint.

Acceptance Criteria

  • A new GET endpoint is created at /v1/models.
  • The endpoint reuses the existing list_models logic but formats the response to exactly match the OpenAI specification.
  • The JSON response should look like this:
  {
    "object": "list",
    "data": [
      {
        "id": "model-id-0",
        "object": "model",
        "created": 1686935002,
        "owned_by": "organization-owner"
      },
      {
        "id": "model-id-1",
        "object": "model",
        "created": 1686935002,
        "owned_by": "organization-owner",
      },
      {
        "id": "model-id-2",
        "object": "model",
        "created": 1686935002,
        "owned_by": "openai"
      },
    ],
    "object": "list"
  }

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions