Endpoint Examples
Send a Prompt
Submit a natural language query for processing
POST
Overview
The messages endpoint allows you to submit natural language queries about blockchain data. The API now processes messages asynchronously, providing a more robust way to handle longer-running queries.
Request Flow
- Submit your query using the
/v1/messages
endpoint - Receive a
processingId
to track your request - Poll the
/v1/messages/{processingId}/status
endpoint to get the final result
Examples
Submitting a Query
Checking Status and Getting Results
Response Statuses
The status endpoint can return the following statuses:
PENDING
: The message has been received and is waiting to be processedPROCESSING
: The message is currently being processedFINISHED
: Processing is complete and the result is availableERROR
: An error occurred during processing
Error Handling
When an error occurs, the status response will include an errorMessage
field with details about what went wrong. Common error scenarios include:
- Invalid API key
- Malformed query
- Processing timeout
- Internal server errors
Best Practices
- Always implement proper error handling and retry logic
- Use appropriate polling intervals (2-3 seconds recommended)
- Set reasonable timeouts for your application
- Store the
processingId
for later reference if needed - Consider implementing a webhook system for production applications
Authorizations
Body
application/json
Response
201
application/json
Message submitted for processing
The response is of type object
.