Clearly specify what constitutes your public API contract to manage versioning expectations and documentation requirements. Distinguish between structured outputs intended for programmatic consumption versus human-readable outputs that may change without being considered breaking changes.

For CLI tools or libraries:

Example in package exports:

{
  "exports": {
    // Public API with stability guarantees
    ".": "./src/public-api.ts",
    
    // Explicitly mark experimental features
    "./experimental": "./src/experimental-features.ts",
    
    // Internal APIs not covered by semver
    "./internal": null
  }
}

When documenting API endpoints, be specific about response headers and their purposes, such as x-artifact-tag for artifact download endpoints. For authentication endpoints, clearly document their scope and intended usage contexts.