API Endpoints
Gateway Endpoints
GET /.well-known/ohttp-gateway
Returns the gateway’s public key configuration.
Response:
- Content-Type:
application/ohttp-keys - Cache-Control:
public, max-age=86400
The response is a binary blob containing the serialized OHTTP key configuration per RFC 9458 Section 3.
Example:
curl https://gateway.ohttp.info/.well-known/ohttp-gateway \
-o gateway-keys.bin
POST /ohttp
Decapsulates an OHTTP request and returns an encapsulated response.
Request:
- Content-Type:
message/ohttp-req(required) - Body: Encapsulated OHTTP request
Response:
- Content-Type:
message/ohttp-res - Body: Encapsulated OHTTP response
Error Responses:
400 Bad Request- Invalid content type or malformed request413 Payload Too Large- Request exceeds 1MB limit500 Internal Server Error- Decapsulation failed (opaque for security)
Relay Endpoints
POST /ohttp
Forwards an encapsulated OHTTP request to the gateway.
Request:
- Content-Type:
message/ohttp-req(required) - Body: Encapsulated OHTTP request
Response:
- Proxied response from gateway
CORS:
Access-Control-Allow-Origin: https://ohttp.info- Preflight requests supported
Example with ohttp-ts:
const response = await fetch('https://relay.ohttp.info/ohttp', {
method: 'POST',
headers: { 'Content-Type': 'message/ohttp-req' },
body: encapsulatedRequest
});
Error Format
All errors follow RFC 9457 Problem Details:
{
"type": "https://ohttp.info/problems/invalid-media-type",
"title": "Invalid Media Type",
"status": 415,
"detail": "Expected message/ohttp-req"
}
Rate Limits
No rate limits are currently enforced. This may change as usage grows.
Size Limits
- Maximum request body: 1MB
- Maximum response body: 1MB