Skip to main content

OpenAPI Ingestion

Ground can index OpenAPI 3.x specifications, providing structured, version-tracked API documentation with strong provenance.

Why Use OpenAPI Sources?

  • Structured data: Operations, parameters, and schemas are parsed and preserved
  • Version tracking: API version from info.version is captured automatically
  • Conflict detection: Different definitions of the same endpoint are detected
  • Better search: Operation metadata enables precise matching

Adding an OpenAPI Source

Via API

Via UI

  1. Go to Sources → Add Source
  2. Select Documentation
  3. Set format to OpenAPI
  4. Enter the URL to your OpenAPI spec (JSON or YAML)
  5. Click Create

Supported Formats

  • OpenAPI 3.0.x (JSON or YAML)
  • OpenAPI 3.1.x (JSON or YAML)
Ground auto-detects the format based on file extension and content.

What Gets Indexed

For each operation in the spec:

Example Chunk

For POST /v1/payment_intents:

Version Tracking

Ground extracts the API version from info.version:
This version appears in citations:

Incremental Updates

Ground uses:
  • ETag/Last-Modified: Conditional requests to skip unchanged specs
  • Content hash: Detect changes when headers aren’t available
  • Schema hash: Track per-operation changes for conflict detection

Conflict Detection

When the same endpoint exists in multiple OpenAPI sources with different schemas, Ground detects the conflict:
This helps identify version inconsistencies across your API documentation.

Best Practices

Prefer the canonical OpenAPI spec from your API provider rather than generated or third-party specs.
If your spec doesn’t have a good info.version, set doc_version_label when creating the source.
Create separate sources for different API versions (v1, v2) to search across all versions with conflict detection.
Trigger a sync whenever your API spec is updated to keep Ground in sync.

Troubleshooting

  • Ensure the URL returns valid JSON or YAML
  • Check for CORS issues (spec must be publicly accessible)
  • Verify the spec is OpenAPI 3.x format
  • Check that operations have the expected HTTP methods
  • Verify paths are properly defined in the spec
  • Add or fix info.version in your OpenAPI spec
  • Or set doc_version_label explicitly on the source