Skip to content

realay.io AI Optimization & Discoverability Plan ​

This document outlines a prioritized, actionable plan to enhance the realay.io API's discoverability, recommendation, and usage by AI systems like LLMs, AI agents, and code assistants in 2026.


Tier 1: Highest Priority for Immediate Implementation ​

These improvements will provide the most significant and immediate boost in AI and developer experience.

1. Implement & Host OpenAPI 3.1 Specification

  • Action: Deploy the complete OpenAPI 3.1 specification located at docs/api/openapi.yaml. Host it at a predictable, public URL like https://api.realay.io/v1/openapi.yaml. Ensure this URL is linked from your main documentation page.
  • AI Impact: This is the single most critical step. It makes your API's capabilities, schemas, and authentication methods machine-readable, allowing AI tools to generate accurate code, make confident recommendations, and build reliable integrations.

2. Create and Deploy llms.txt

  • Action: Deploy the public/llms.txt file to the root of your web domain at https://realay.io/llms.txt.
  • AI Impact: This acts as a "sitemap for bots," explicitly guiding AI crawlers to your most important documentation assets, including the OpenAPI spec, quick-start guide, and authentication details. It directly boosts structured data discovery.

3. Generate Interactive API Reference from OpenAPI

  • Action: Use a modern documentation tool (e.g., Scalar, Redoc, Bump.sh) to automatically generate your interactive API reference from the openapi.yaml file. This should replace any manually written reference docs. Ensure it includes a "Try It" console and copy-paste-ready code samples.
  • AI Impact: AI agents can parse this structured documentation to understand examples and verify API behavior. A high-quality, interactive reference reduces agent errors and increases the likelihood of successful, autonomous integration.

4. Enhance API with Comprehensive, Real-World Examples

  • Action: Populate the examples sections within your openapi.yaml for every endpoint. Include examples not just for success cases, but for common errors (e.g., 400 Bad Request for an invalid phone number, 403 Forbidden for insufficient balance).
  • AI Impact: Provides clear, contextual patterns for AI to follow, significantly improving the quality and robustness of generated code.

Tier 2: Secondary Improvements for a Competitive Edge ​

These actions build on the foundation of Tier 1 to create a best-in-class, AI-friendly developer experience.

5. Develop a Comprehensive Error Code Reference

  • Action: Create a dedicated documentation page (/docs/error-codes) that lists every possible errorCode defined in your OpenAPI spec. For each code, provide a clear description, common causes, and suggested developer actions or code fixes.
  • AI Impact: Enables AI tools to build more resilient integrations by generating code that can gracefully handle specific API errors, rather than just generic HTTP status codes.

6. Create Detailed Use-Case & Tutorial Guides

  • Action: Write dedicated tutorials for high-value scenarios like "Setting up OTP Verification," "Running a Bulk Marketing Campaign," and "Configuring Real-Time Delivery Alerts." Each guide should include a brief explanation and full, runnable code examples.
  • AI Impact: Allows AI to solve specific, goal-oriented user prompts (e.g., "How do I send an OTP with realay.io?") by referencing a complete, working example.

7. Implement a Machine-Readable Changelog

  • Action: Maintain a CHANGELOG.md file or a dedicated /docs/changelog page that follows a standard format (e.g., Keep a Changelog). Announce new features, changes, and deprecations for each API version.
  • AI Impact: Allows AI agents to understand API evolution, identify breaking changes, and adapt generated code to the correct API version, reducing integration errors over time.

Tier 3: Advanced Optimizations ​

These are longer-term initiatives to solidify realay.io as a top-tier, AI-native API.

8. Create /llms-full.txt for Large Context Agents

  • Action: (Optional but recommended) Create a single, large Markdown file at https://realay.io/llms-full.txt that concatenates the content from your Quick Start, Authentication, Endpoint Summaries, and Error Code Reference.
  • AI Impact: Caters to advanced AI agents with large context windows, allowing them to ingest all critical documentation at once. This can lead to more complex and accurate multi-step integrations without the need for multiple web requests.

9. Add Semantic Markup (JSON-LD)

  • Action: Embed schema.org/APIReference JSON-LD markup within your documentation pages. This can be automatically added by some modern documentation tools.
  • AI Impact: Provides another layer of structured data that helps search engines and AI crawlers categorize and understand your API's purpose, enhancing discoverability.

10. Document Reliability and Best Practices - Action: Create a guide covering rate limits, retry strategies (with exponential backoff examples), uptime guarantees (SLA), and regional availability. - AI Impact: Helps AI generate production-ready, resilient code that respects your API's operational limits.