Skip to main content
All Raysurfer functionality is available over plain HTTP. Every request uses POST with a JSON body (except health check and deletion).

Authentication

Include your API key in the Authorization 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

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

Response:

Error responses

All errors return a JSON body with a detail field:

Full example: search then upload

A complete workflow — pull cached code, use it, then push results back: