CometAPI · API Governance Rules

CometAPI API Rules

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

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

Rule Categories

cometapi

Rules

error
cometapi-info-contact
API info must include a contact block.
$.info
error
cometapi-server-https
Server URLs must use HTTPS.
$.servers[*].url
warn
cometapi-server-host
Public server URL should point to api.cometapi.com.
$.servers[*].url
info
cometapi-versioned-base-path
Server URL should include /v1 to match OpenAI compatibility.
$.servers[*].url
error
cometapi-bearer-security
API must define a bearer-token security scheme.
$.components.securitySchemes[*]
error
cometapi-operation-id
Every operation must declare a unique operationId.
$.paths[*][get,post,put,patch,delete]
warn
cometapi-operation-tags
Operations must declare at least one tag.
$.paths[*][get,post,put,patch,delete]
warn
cometapi-error-responses
Mutating operations should declare 401 and 429 error responses.
$.paths[*][post].responses
info
cometapi-model-field
Generative endpoints must accept a `model` request field for routing.
$.paths[*][post].requestBody.content['application/json'].schema.properties

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas

# Spectral linting rules for CometAPI.
# Tuned to api.cometapi.com/v1 conventions: OpenAI-compatible endpoints,
# bearer-token auth, and a `model` routing field on every generative call.
rules:
  cometapi-info-contact:
    description: API info must include a contact block.
    severity: error
    given: "$.info"
    then:
      field: contact
      function: truthy

  cometapi-server-https:
    description: Server URLs must use HTTPS.
    severity: error
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "^https://"

  cometapi-server-host:
    description: Public server URL should point to api.cometapi.com.
    severity: warn
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "api.cometapi.com"

  cometapi-versioned-base-path:
    description: Server URL should include /v1 to match OpenAI compatibility.
    severity: info
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "/v1"

  cometapi-bearer-security:
    description: API must define a bearer-token security scheme.
    severity: error
    given: "$.components.securitySchemes[*]"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            type:
              enum: ["http"]
            scheme:
              enum: ["bearer"]

  cometapi-operation-id:
    description: Every operation must declare a unique operationId.
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  cometapi-operation-tags:
    description: Operations must declare at least one tag.
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: schema
      functionOptions:
        schema:
          type: array
          minItems: 1

  cometapi-error-responses:
    description: Mutating operations should declare 401 and 429 error responses.
    severity: warn
    given: "$.paths[*][post].responses"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          anyOf:
            - required: ["401"]
            - required: ["429"]

  cometapi-model-field:
    description: Generative endpoints must accept a `model` request field for routing.
    severity: info
    given: "$.paths[*][post].requestBody.content['application/json'].schema.properties"
    then:
      field: model
      function: truthy

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/cometapi-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.