Convert Raycast AI API to OpenAI-compatible API. Built with HonoJS, supports Raycast V2 authentication, deployable to Cloudflare Workers / Docker / Local Binary.
This project is based on raycast-relay, which has been archived and is no longer maintained. The original project does not support the new Raycast V2 authentication system that is now required. This version utilizes Hono and provides support for Raycast V2 authentication.
⚠️ Be aware that not setting the API_KEY environment variable leaves your API open to anyone.
docker run -d \
--name raycast2api \
-p 3000:3000 \
-e RAYCAST_BEARER_TOKEN=your-raycast-bearer-token \
-e RAYCAST_DEVICE_ID=your-raycast-device-id \
ghcr.io/xxxbrian/raycast2api:latestDownload the latest release from Releases and run it.
| Environment Variable | Required | Description | Default |
|---|---|---|---|
RAYCAST_BEARER_TOKEN |
Yes | Raycast API Token | None |
RAYCAST_DEVICE_ID |
Yes | Raycast Device ID | None |
RAYCAST_SIGNATURE_SECRET |
No | V2 Signature Secret | Has default |
API_KEY |
No | Client authentication key | None (public access) |
ADVANCED |
No | Include advanced models | true |
INCLUDE_DEPRECATED |
No | Include deprecated models | false |
Use proxy tools (like Proxyman, Charles) to capture Raycast app network requests:
- Set up proxy and trust certificate
- Add
backend.raycast.comto SSL proxy list - Send AI request in Raycast
- Extract from request headers:
Authorization: Bearer <token>→RAYCAST_BEARER_TOKENX-Raycast-DeviceId→RAYCAST_DEVICE_ID
Deployed API URL: https://your-worker.your-account.workers.dev/
GET /v1/models- Get model listPOST /v1/chat/completions- Chat completion (OpenAI compatible)GET /health- Health check
Implements Raycast V2 signature authentication:
- ROT13+ROT5 encoding
- HMAC-SHA256 signing
- Timestamp validation
- Device ID binding
src/
├── index.ts # Main entry
├── config.ts # Configuration
├── types.ts # Type definitions
├── utils.ts # Utils and auth
└── handlers/
├── chat.ts # Chat handler
└── models.ts # Models handler
server.ts # Bun server entry for local binary
bun run dev # Cloudflare Workers dev mode
bun run dev:local # Local dev mode