Skip to content

docs: clarify TEE endpoint discovery and x402 payment settlement#242

Merged
adambalogh merged 1 commit intoOpenGradient:mainfrom
addnad:docs/fix-x402-endpoint-urls
Apr 6, 2026
Merged

docs: clarify TEE endpoint discovery and x402 payment settlement#242
adambalogh merged 1 commit intoOpenGradient:mainfrom
addnad:docs/fix-x402-endpoint-urls

Conversation

@addnad
Copy link
Copy Markdown
Contributor

@addnad addnad commented Apr 6, 2026

Summary

Clarifies TEE endpoint discovery and x402 payment settlement in the LLM documentation to resolve confusion about which endpoint URL to use and prevent costly developer errors.

Problem

Issue #229 reported critical inconsistencies that created confusion and risk:

  • Overview docs listed one endpoint URL (https://llm.opengradient.ai)
  • Code examples used a different URL (https://llmogevm.opengradient.ai)
  • Developers didn't know which URL was correct
  • Using the wrong endpoint could result in failed transactions
  • Real money ($OPG tokens) could be lost due to misconfiguration

Solution

Added a comprehensive section to docs/opengradient/client/llm.md explaining:

Production Use: Automatic Endpoint Discovery

  • Default LLM() constructor automatically discovers active TEE endpoints from on-chain registry
  • Recommended approach for production deployments
  • Ensures high availability through automatic failover

Development Use: Manual Endpoint Configuration

  • LLM.from_url() for hardcoded endpoints
  • Perfect for self-hosted or testing scenarios
  • TLS certificate verification disabled for self-signed certs

x402 Payment Settlement (Key Clarification)

  • Regardless of which TEE endpoint serves the inference request, x402 payments always settle on Base Sepolia blockchain
  • This ensures consistency, auditability, and independent payment tracking
  • Developers can safely switch between endpoints without affecting payment processing

Changes

  • Added ~40 lines of clear, practical documentation
  • Included working code examples for both approaches
  • Emphasized separation of concerns: endpoint serving vs. payment settlement
  • Reduced developer confusion about endpoint selection

User Impact

This change helps developers by:

  • ✅ Clearly explaining the endpoint discovery mechanism
  • ✅ Providing examples for both production and development scenarios
  • ✅ Reducing confusion about where payments are settled
  • ✅ Preventing misconfiguration errors
  • ✅ Making endpoint migration between environments easier
  • ✅ Improving developer experience and trust

Related

Fixes #229

- Add section explaining automatic endpoint discovery from TEE registry
- Document LLM.from_url() for development/self-hosted setups
- Clarify that x402 payments always settle on Base Sepolia
- Reduce confusion about multiple endpoint URLs

Fixes OpenGradient#229
@adambalogh adambalogh merged commit c4673d6 into OpenGradient:main Apr 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Inconsistent API endpoint URLs across x402 docs

2 participants