High-Level Client
RaysurferClient
Drop-in replacement for Claude Agent SDK’sClaudeSDKClient.
Constructor Parameters
Python —RaysurferClient(options, workspace_id=None, debug=False):
TypeScript —
new RaysurferClient(options) where options is a single object:
Methods
Low-Level API Client
RaySurfer / AsyncRaySurfer
Constructor Options
search
Search for cached code snippets by task description.Parameters
Returns: SearchResponse
Queries can be any length, but shorter queries (under 200 characters) give the best accuracy and speed. Longer queries are automatically rephrased into multiple shorter searches and merged, which adds latency and may reduce precision.
upload
Upload a code file from an execution for future reuse.Parameters
Returns: SubmitExecutionResultResponse
When
use_raysurfer_ai_voting is true (the default) and no user_vote is provided, each newly stored code block is automatically evaluated by Raysurfer’s AI. If you provide a user_vote, AI voting is skipped entirely — your vote is applied directly.upload_bulk_code_snips / uploadBulkCodeSnips
Bulk upload prompts, logs, and code files for sandboxed grading.Parameters
Returns: BulkExecutionResultResponse
delete
Delete a snippet and all its associated data (vectors, retrieval logs, votes).Parameters
Returns: DeleteResponse
vote_code_snip / voteCodeSnip
Vote on whether a cached code snippet was useful. This triggers background voting on the backend.Returns: VoteCodeSnipResponse
Voting is triggered automatically by
upload when use_raysurfer_ai_voting is true (the default), and also by the high-level RaysurferClient. Use vote_code_snip directly only for voting on cached blocks after reuse.Response Types
SearchResponse
Returned bysearch().
SubmitExecutionResultResponse
Returned byupload().
BulkExecutionResultResponse
Returned byupload_bulk_code_snips().
DeleteResponse
Returned bydelete().
VoteCodeSnipResponse
Returned byvote_code_snip().
Data Types
SearchMatch
A single result fromsearch(). Contains a full CodeBlock plus a relevance score.
FunctionReputation
Per-function reputation metadata returned onSearchMatch.functions.
CodeBlock
A stored code block with full metadata. Nested inside SearchMatch.Input Types
FileWritten
A file created during agent execution. Used byupload() and upload_bulk_code_snips().
LogFile
A log file for bulk grading. Used byupload_bulk_code_snips().
Enums
ExecutionState
Technical execution outcome.AgentVerdict
Agent’s judgment on execution quality.SnipsDesired
Scope of private snippets for retrieval.Exceptions
Both SDKs include built-in retry logic with exponential backoff for transient failures (429, 5xx, network errors). You don’t need to implement your own retry logic for these cases.
