OpenAI-compatible proxy for Raycast AI, deployed as a Cloudflare Worker.
Features
- OpenAI-compatible
v1/chat/completionsandv1/models - Raycast model catalog with capability metadata and reroute logging
- Vision input via image uploads
- Remote tools for web and image generation
model:effortshorthand for reasoning effort
Setup
- Install and deploy.
npm install npm run deploy
- Configure secrets.
wrangler secret put RAYCAST_TOKEN wrangler secret put IMAGE_TOKEN wrangler secret put API_KEY
Config
RAYCAST_TOKEN: Required to access Advanced AI models. Extract from Raycast app requests.IMAGE_TOKEN: Token used only for image uploads. Advanced subscription not required.API_KEY: Optional. If set, requests must includeAuthorization: Bearer <key>.DEVICE_ID: Optional 64-char hex. If unset, the worker generates one and caches it.SIG_SECRET: Optional override for Raycast signature secret.DEBUG: Set to1ortruefor verbose logs.
Usage
Base URL:
https://your-worker.your-subdomain.workers.dev/v1
Basic chat:
curl https://your-worker.your-subdomain.workers.dev/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "model": "gpt-4o-mini", "messages": [{ "role": "user", "content": "Hello from Raycast Relay" }] }'
Remote tools require tool_choice and a matching tool name. Raycast runs them server-side.
Web search example:
curl https://your-worker.your-subdomain.workers.dev/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "model": "gpt-4o-mini", "messages": [{ "role": "user", "content": "@web search the web for Raycast founders" }], "tools": [ { "type": "function", "function": { "name": "web_search", "description": "Search the web" } } ], "tool_choice": "required" }'
Image generation with Nano Banana using Gemini 3 Flash:
curl https://your-worker.your-subdomain.workers.dev/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": "@nano_banana create a stylized poster of a nano banana on a plate" } ], "tools": [ { "type": "function", "function": { "name": "nano_banana", "description": "Generate an image" } } ], "tool_choice": "required" }'
Image results are returned as markdown image URLs in the assistant content.
Remote Tool Names
web_search,search_images,read_pagedalle,gpt_image,gemini_image,nano_banana,flux,flux-kontext,stable_diffusion,chart
Reasoning Effort You can set reasoning effort in two ways:
- Use
reasoning_effortin the request body - Append
:effortto the model name, for examplegpt-4o-mini:low
If both are provided, reasoning_effort wins.
Models
/v1/modelsincludes Advanced AI models only whenRAYCAST_TOKENis present.- Each model includes
access(freeorpro) andreplacement_model_idwhen applicable. - If Raycast reroutes a request, it is logged.
License
MIT. See LICENSE.