microsoft / microsoft/foundry-local

[cli] Move openapi urls to /openapi

Open
#796 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
2.6k
Forks
369
Avg merge
2d 17h
Merged PRs (30d)
39

Description

as discussed in #774

My proposed change is something like this:

| api | previous | new | proposed |
|---|---|---|---|
| foundry | /openai/status | /status | foundry/v1/status |
| foundry | | /shutdown | foundry/v1/shutdown |
| foundry | /openai/loadedmodels | /models/loaded | foundry/v1/models/loaded |
| foundry | /openai/load/{name} | /models/load/{name} | foundry/v1/models/load/{name} |
| foundry | /openai/unload/{name} | /models/unload/{name} | foundry/v1/models/unload/{name} |
| openai | | /v1/models | openai/v1/models |
| openai | | /v1/models/{name} | openai/v1/models/{name} |
| openai | /v1/chat/completions | /v1/chat/completions | openai/v1/chat/completions |
| openai | /v1/audio/transcriptions | /v1/audio/transcriptions | openai/v1/audio/transcriptions |
| openai | | /v1/embeddings | openai/v1/embeddings |
| openai | | /v1/responses | openai/v1/responses |
| openai | | /v1/responses/{id} | openai/v1/responses/{id} |
| openai | | /v1/responses/{id}/input_items | openai/v1/responses/{id}/input_items |

When using an openai compatible client you would then use `http://localhost:xxxx/openapi/v1` as the base url
This also leaves a path for non-breaking upgrades to foundry api, and adding other rest apis like ollama or anthropic.

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

No source files or tests are named. Start by locating the CLI's OpenAPI route registration and the endpoint tests, then compare the current paths with the proposed table. Done means the routes use the /openapi/{api}/v1 structure, including foundry and openai endpoints, while the compatible client base URL works as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, openapi
Domain
api, backend-api-design, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.