Tesla Energy · API Governance Rules

Tesla Energy API Rules

Spectral linting rules defining API design standards and conventions for Tesla Energy.

8 Rules error 2 warn 6
View Rules File View on GitHub

Rule Categories

tesla

Rules

warn
tesla-energy-info-contact
Tesla Energy API specs must declare a contact pointing at developer.tesla.com.
$.info.contact
error
tesla-energy-bearer-auth
All operations must use the BearerAuth security scheme.
$.paths.*[get,post,put,delete,patch]
warn
tesla-energy-energy-sites-path
Energy site paths must live under /energy_sites/{site_id}/...
$.paths
warn
tesla-energy-title-case-summary
Operation summaries should be in Title Case and start with "Tesla ".
$.paths.*[get,post,put,delete,patch].summary
warn
tesla-energy-snake-case-properties
Schema properties should be snake_case to match Tesla's payload conventions.
$.components.schemas.*.properties.*~
warn
tesla-energy-operation-id-camel
Operation IDs should be camelCase.
$.paths.*[get,post,put,delete,patch].operationId
warn
tesla-energy-401-defined
All operations must declare a 401 Unauthorized response.
$.paths.*[get,post,put,delete,patch].responses
error
tesla-energy-server-fleet
Server URL must point at a fleet-api.*.cloud.tesla.com host.
$.servers.*

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
formats:
  - oas3
documentationUrl: https://developer.tesla.com/docs/fleet-api/endpoints/energy
description: Spectral ruleset enforcing Tesla Fleet Energy API conventions — bearer-auth, energy_sites
  path shape, snake_case fields, title-case summaries, and standard error responses.
rules:
  tesla-energy-info-contact:
    description: Tesla Energy API specs must declare a contact pointing at developer.tesla.com.
    given: $.info.contact
    severity: warn
    then:
      field: url
      function: pattern
      functionOptions:
        match: '^https://(developer|www)\.tesla\.com.*$'
  tesla-energy-bearer-auth:
    description: All operations must use the BearerAuth security scheme.
    given: $.paths.*[get,post,put,delete,patch]
    severity: error
    then:
      field: security
      function: defined
  tesla-energy-energy-sites-path:
    description: Energy site paths must live under /energy_sites/{site_id}/...
    given: $.paths
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^/(products|energy_sites/.*)$'
  tesla-energy-title-case-summary:
    description: Operation summaries should be in Title Case and start with "Tesla ".
    given: $.paths.*[get,post,put,delete,patch].summary
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^Tesla [A-Z][A-Za-z0-9\- ]+$'
  tesla-energy-snake-case-properties:
    description: Schema properties should be snake_case to match Tesla's payload conventions.
    given: $.components.schemas.*.properties.*~
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^[a-z][a-z0-9_]*$'
  tesla-energy-operation-id-camel:
    description: Operation IDs should be camelCase.
    given: $.paths.*[get,post,put,delete,patch].operationId
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^[a-z][A-Za-z0-9]+$'
  tesla-energy-401-defined:
    description: All operations must declare a 401 Unauthorized response.
    given: $.paths.*[get,post,put,delete,patch].responses
    severity: warn
    then:
      field: '401'
      function: defined
  tesla-energy-server-fleet:
    description: Server URL must point at a fleet-api.*.cloud.tesla.com host.
    given: $.servers.*
    severity: error
    then:
      field: url
      function: pattern
      functionOptions:
        match: '^https://fleet-api\.(prd|stg)\.[a-z]+\.vn\.cloud\.tesla\.com/api/1$'

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/tesla-energy-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.