cd /news/developer-tools/should-ai-api-specifications-live-in… · home topics developer-tools article
[ARTICLE · art-100721] src=discuss.huggingface.co ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Should AI API Specifications Live in Git Alongside the Model Code?

A developer proposes treating OpenAPI specifications as first-class Git artifacts for machine learning and inference projects, suggesting that API contracts should live alongside model code and configuration in version control. The author has been experimenting with Apidog's Spec-first workflow, where the Git repository serves as the source of truth for API specifications, and asks how teams manage API specifications for inference endpoints.

read1 min views4 publishedAug 18, 2026

I’ve been thinking about how we version APIs for ML and inference projects.

With model code, configuration, and deployment files already living in Git, it seems natural to keep the API contract there as well.

For example: model/code → OpenAPI specification → API tests → deployment

This is where the idea of a git-native API workspace becomes interesting to me.

Instead of designing an API in one place and synchronizing it with a repository later, the OpenAPI specification could be treated as a first-class Git artifact:

This seems particularly useful for inference APIs where endpoints, parameters, model versions, and response schemas can evolve quickly.

I’ve been experimenting with Apidog’s Spec-first workflow, where the Git repository can serve as the source of truth for OpenAPI specifications.

I’m curious how others are handling this.

For Hugging Face Spaces, Inference Endpoints, or custom model-serving APIs: Do you keep your API specification in Git alongside the model/application code?

Or do you prefer managing the API contract in a separate API workspace and syncing it with Git afterward?

I’d be especially interested in hearing from teams managing multiple models or frequently changing inference endpoints.

── more in #developer-tools 4 stories · sorted by recency
── more on @apidog 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/should-ai-api-specif…] indexed:0 read:1min 2026-08-18 ·