{"slug": "should-ai-api-specifications-live-in-git-alongside-the-model-code", "title": "Should AI API Specifications Live in Git Alongside the Model Code?", "summary": "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.", "body_md": "I’ve been thinking about how we version APIs for ML and inference projects.\n\nWith model code, configuration, and deployment files already living in Git, it seems natural to keep the API contract there as well.\n\nFor example:\n\n**model/code → OpenAPI specification → API tests → deployment**\n\nThis is where the idea of a **git-native API workspace** becomes interesting to me.\n\nInstead 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:\n\nThis seems particularly useful for inference APIs where endpoints, parameters, model versions, and response schemas can evolve quickly.\n\nI’ve been experimenting with Apidog’s Spec-first workflow, where the Git repository can serve as the source of truth for OpenAPI specifications.\n\nI’m curious how others are handling this.\n\nFor Hugging Face Spaces, Inference Endpoints, or custom model-serving APIs:\n\n**Do you keep your API specification in Git alongside the model/application code?**\n\nOr do you prefer managing the API contract in a separate API workspace and syncing it with Git afterward?\n\nI’d be especially interested in hearing from teams managing multiple models or frequently changing inference endpoints.", "url": "https://wpnews.pro/news/should-ai-api-specifications-live-in-git-alongside-the-model-code", "canonical_source": "https://discuss.huggingface.co/t/should-ai-api-specifications-live-in-git-alongside-the-model-code/178785#post_1", "published_at": "2026-08-18 02:58:30+00:00", "updated_at": "2026-08-18 03:11:47.924590+00:00", "lang": "en", "topics": ["developer-tools", "mlops", "ai-infrastructure"], "entities": ["Apidog", "Hugging Face Spaces", "Inference Endpoints"], "alternates": {"html": "https://wpnews.pro/news/should-ai-api-specifications-live-in-git-alongside-the-model-code", "markdown": "https://wpnews.pro/news/should-ai-api-specifications-live-in-git-alongside-the-model-code.md", "text": "https://wpnews.pro/news/should-ai-api-specifications-live-in-git-alongside-the-model-code.txt", "jsonld": "https://wpnews.pro/news/should-ai-api-specifications-live-in-git-alongside-the-model-code.jsonld"}}