POST with a JSON body (except health check and deletion).
Authentication
Include your API key in theAuthorization header:
Optional headers
Base URL
Retrieve
Search for code snippets
The primary retrieval endpoint. Returns cached code blocks ranked by semantic similarity, community votes, and error resilience.
Response:
Get few-shot examples
Get task patterns
Query execution history
Store
Upload code from an execution (recommended)
The simplest way to store code. Send the files your agent wrote and the task it was solving. The backend auto-detects language, entrypoint, and tags, then optionally votes on quality.Bulk upload with grading
Upload multiple prompts and files. The backend grades each file independently.Store a code block (advanced)
Store a single code block with full metadata. Use this when you need fine-grained control over what’s stored.Delete a snippet
Check background task status
Vote
Record whether cached code was useful. This feeds back into the scoring system so better code surfaces higher.Voting happens automatically when
use_raysurfer_ai_voting is true (the default) in the store endpoints. You can also provide user_vote or user_votes to vote yourself — AI voting is skipped when user votes are provided. Use the vote endpoint directly only when you need manual control over cached code blocks.Health check
Error responses
All errors return a JSON body with adetail field:
