How to authenticate requests to Uniblock WebSocket endpoints using your API key, including URL query parameters and header-based auth for supported providers.
Most Uniblock WebSocket endpoints use the following header:
Header: X-API-KEY
Value: Your unique Uniblock API key
Some provider-specific endpoints use query parameter authentication instead.
For example, Codex accepts apiKey as a query parameter and requires the API key
in the GraphQL WebSocket connection_init payload under Authorization.
Authentication flow
Use the same authentication header for both steps of the connection flow:
Send an HTTP request to the provider’s /validate endpoint.
Open the corresponding WSS endpoint.
Send your provider-specific subscription or message payload.
Use a WebSocket client that supports custom headers so you can pass
X-API-KEY during connection setup.
Example validation request
curl --request GET \ --url 'https://websocket.uniblock.dev/ankr/validate?chainId=1' \ --header 'X-API-KEY: YOUR_UNIBLOCK_API_KEY'
Notes
Reuse the same header values when moving from validation to the WebSocket
connection.
Some providers require additional query parameters such as chainId or
apiKey.
Message formats after connection are provider-specific.