Skip to content

API Style

Use REST with OpenAPI 3.1 as the default service contract. Add GraphQL only when clients need flexible graph-shaped queries that would otherwise create too many REST endpoints.

Tradeoffs

ChoiceBest fitStrengthCost
REST + OpenAPITool-friendly service operationsMature tooling, easy auth, clear operation IDsCan overgrow for complex graph queries
GraphQLClient-shaped domain queriesEfficient flexible readsMore complex caching, auth, and schema governance
JSON SchemaShared payload validationReusable across APIs and toolsDoes not define transport behavior
Event APIsAsynchronous domain updatesGood for streaming system stateHarder for simple agent request/response tasks

Architecture Guidance

  • Keep API operation IDs stable because agents and tool wrappers may depend on them.
  • Publish authored or exported API contracts as machine-readable artifacts.
  • Use JSON Schema-compatible request and response shapes where possible.
  • Require auth scopes in the OpenAPI contract for protected operations.

Example Artifact

Page created by Dr. C. Klukas