openai / openai/openai-openapi

Proposal: Add capabilities field to /v1/models response

Open
#537 0 comments 16 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api enhancement
Dominant language
No language data
Stars
2.5k
Forks
527
Avg merge
1h 46m
Merged PRs (30d)
2

Description

Problem

Every LLM framework (LangChain, LiteLLM, Vercel AI SDK, etc.) maintains its own hardcoded model registry to answer basic questions like:

  • Does this model support tool/function calling?
  • Does it support vision (image inputs)?
  • Does it support structured output / JSON mode?
  • What is the context window size?

These registries are always stale, always incomplete, and always divergent. Every new model release triggers a wave of PRs across dozens of repos just to update capability flags.

Root Cause

The /v1/models endpoint returns almost no useful metadata:

{
  "id": "gpt-4o",
  "object": "model",
  "created": 1715367049,
  "owned_by": "system"
}

There is no machine-readable way to discover what a model can actually do.

Proposal

Add a capabilities object to the /v1/models/{model} response:

{
  "id": "gpt-4o",
  "object": "model",
  "created": 1715367049,
  "owned_by": "system",
  "capabilities": {
    "tool_calling": true,
    "vision": true,
    "structured_output": true,
    "json_mode": true,
    "streaming": true,
    "context_window": 128000,
    "max_output_tokens": 16384
  }
}

This is a backwards-compatible, additive change. Existing clients would simply ignore the new field.

Impact

  • Eliminates the need for hardcoded model registries across the ecosystem
  • Enables dynamic capability negotiation (agents can adapt to whatever model they are given)
  • Reduces maintenance burden for every framework that builds on the OpenAI-compatible API
  • Sets a standard that other providers (Anthropic, Google, Mistral, etc.) can adopt

Prior Art

This would be a small schema change with outsized ecosystem impact.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the OpenAPI schema for the /v1/models endpoint and compare the collection and per-model response shapes. Done means the schema defines the proposed capabilities object and its listed fields while preserving the existing response fields and documenting the additive behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.