TrueFoundry · API Governance Rules

TrueFoundry API Rules

Spectral linting rules defining API design standards and conventions for TrueFoundry.

9 Rules error 3 warn 4
View Rules File View on GitHub

Rule Categories

truefoundry

Rules

warn
truefoundry-operation-summary-title-case
Operation summaries must use Title Case
$.paths[*][*].summary
error
truefoundry-operation-tags-required
All operations must have at least one tag
$.paths[*][*]
error
truefoundry-bearer-auth-required
API must use Bearer authentication
$.components.securitySchemes.*
warn
truefoundry-model-param-required
LLM operations should require a model parameter
$.paths[/chat/completions,/embeddings,/rerank][post].requestBody.content.application/json.schema.required
error
truefoundry-openai-compatible-success
POST endpoints should return 200 or 201 for success
$.paths[*][post]
warn
truefoundry-error-response-shape
Error responses should include an error object with message field
$.paths[*][*].responses[4*,5*].content.application/json.schema.properties
hint
truefoundry-usage-in-response
Completion responses should include usage statistics
$.components.schemas.ChatCompletionResponse.properties
hint
truefoundry-streaming-documented
Chat completions should document streaming support
$.paths[/chat/completions][post].requestBody.content.application/json.schema.properties
warn
truefoundry-openai-compatibility
The API follows OpenAI-compatible conventions for model, messages, and response format
$.paths[/chat/completions][post].requestBody.content.application/json.schema.required

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  truefoundry-operation-summary-title-case:
    description: Operation summaries must use Title Case
    severity: warn
    given: "$.paths[*][*].summary"
    then:
      function: pattern
      functionOptions:
        match: "^([A-Z][a-z]* ?)+$"

  truefoundry-operation-tags-required:
    description: All operations must have at least one tag
    severity: error
    given: "$.paths[*][*]"
    then:
      field: tags
      function: truthy

  truefoundry-bearer-auth-required:
    description: API must use Bearer authentication
    severity: error
    given: "$.components.securitySchemes.*"
    then:
      field: type
      function: enumeration
      functionOptions:
        values:
          - http

  truefoundry-model-param-required:
    description: LLM operations should require a model parameter
    severity: warn
    given: "$.paths[/chat/completions,/embeddings,/rerank][post].requestBody.content.application/json.schema.required"
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          contains:
            type: string
            enum:
              - model

  truefoundry-openai-compatible-success:
    description: POST endpoints should return 200 or 201 for success
    severity: error
    given: "$.paths[*][post]"
    then:
      field: responses
      function: schema
      functionOptions:
        schema:
          type: object
          minProperties: 1

  truefoundry-error-response-shape:
    description: Error responses should include an error object with message field
    severity: warn
    given: "$.paths[*][*].responses[4*,5*].content.application/json.schema.properties"
    then:
      field: error
      function: truthy

  truefoundry-usage-in-response:
    description: Completion responses should include usage statistics
    severity: hint
    given: "$.components.schemas.ChatCompletionResponse.properties"
    then:
      field: usage
      function: truthy

  truefoundry-streaming-documented:
    description: Chat completions should document streaming support
    severity: hint
    given: "$.paths[/chat/completions][post].requestBody.content.application/json.schema.properties"
    then:
      field: stream
      function: truthy

  truefoundry-openai-compatibility:
    description: >-
      The API follows OpenAI-compatible conventions for model, messages,
      and response format
    severity: warn
    given: "$.paths[/chat/completions][post].requestBody.content.application/json.schema.required"
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          contains:
            type: string
            enum:
              - messages

Work with this as data

Every ruleset here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for spectral rules

4 MCP tools reach this
  • find_rulesBrowse and filter every ruleset in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This ruleset
curl "https://apis.io/api/v1/rules/truefoundry-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.