Civitai · API Governance Rules

Civitai API Rules

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

10 Rules error 3 warn 7
View Rules File View on GitHub

Rule Categories

civitai

Rules

warn
civitai-info-contact
Civitai specs must declare Civitai developer contact.
$.info.contact
warn
civitai-info-license
Civitai specs reference Civitai's Terms of Service for licensing.
$.info.license
error
civitai-server-https
Civitai API servers must use HTTPS.
$.servers[*].url
error
civitai-operation-id-camel
Civitai operationIds are camelCase.
$.paths.*[get,post,put,patch,delete,head].operationId
warn
civitai-operation-summary-title-case
Civitai operation summaries use Title Case.
$.paths.*[get,post,put,patch,delete,head].summary
error
civitai-bearer-auth-required
Civitai specs must declare a Bearer security scheme.
$.components.securitySchemes
warn
civitai-buzz-cost-on-orchestration
Orchestration responses must surface a `cost` field with currency BUZZ.
$.components.schemas.Workflow.properties.cost
warn
civitai-error-schema-defined
A shared Error schema must be defined.
$.components.schemas.Error
warn
civitai-no-pickle-in-examples
Examples should not encourage PickleTensor; SafeTensor is preferred.
$..files[?(@.format)]
warn
civitai-webhook-events-enum
Workflow callback events must use the Civitai event enum.
$.components.schemas.WorkflowRequest.properties.callbackEvents.items

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
formats:
  - oas3_1
documentationUrl: https://developer.civitai.com/
rules:
  civitai-info-contact:
    description: Civitai specs must declare Civitai developer contact.
    given: $.info.contact
    severity: warn
    then:
      field: url
      function: truthy

  civitai-info-license:
    description: Civitai specs reference Civitai's Terms of Service for licensing.
    given: $.info.license
    severity: warn
    then:
      field: name
      function: truthy

  civitai-server-https:
    description: Civitai API servers must use HTTPS.
    given: $.servers[*].url
    severity: error
    then:
      function: pattern
      functionOptions:
        match: '^https://'

  civitai-operation-id-camel:
    description: Civitai operationIds are camelCase.
    given: $.paths.*[get,post,put,patch,delete,head].operationId
    severity: error
    then:
      function: pattern
      functionOptions:
        match: '^[a-z][a-zA-Z0-9]+$'

  civitai-operation-summary-title-case:
    description: Civitai operation summaries use Title Case.
    given: $.paths.*[get,post,put,patch,delete,head].summary
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^[A-Z][A-Za-z]*(\s[A-Z][A-Za-z]*)*$'

  civitai-bearer-auth-required:
    description: Civitai specs must declare a Bearer security scheme.
    given: $.components.securitySchemes
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            BearerAuth:
              type: object
              properties:
                type: { const: http }
                scheme: { const: bearer }
              required: [type, scheme]
          required: [BearerAuth]

  civitai-buzz-cost-on-orchestration:
    description: Orchestration responses must surface a `cost` field with currency BUZZ.
    given: $.components.schemas.Workflow.properties.cost
    severity: warn
    then:
      function: truthy

  civitai-error-schema-defined:
    description: A shared Error schema must be defined.
    given: $.components.schemas.Error
    severity: warn
    then:
      function: truthy

  civitai-no-pickle-in-examples:
    description: Examples should not encourage PickleTensor; SafeTensor is preferred.
    given: $..files[?(@.format)]
    severity: warn
    then:
      field: format
      function: pattern
      functionOptions:
        notMatch: '^PickleTensor$'

  civitai-webhook-events-enum:
    description: Workflow callback events must use the Civitai event enum.
    given: $.components.schemas.WorkflowRequest.properties.callbackEvents.items
    severity: warn
    then:
      field: enum
      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/civitai-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.