← garyai

Activate your AI connection.

The chat interface and server are prepared. This alternative lets you keep your OpenAI key in your own Cloudflare account.

  1. Sign in to Cloudflare. Open Workers & Pages, choose Create application, then create a Worker using the Hello World option.
  2. Open the Worker's Edit code editor. Replace the sample code with this prepared backend.

    · Download code

  3. Deploy the Worker. In its Settings → Variables and Secrets, add two Secret values:

    OPENAI_API_KEY: your OpenAI API key
    GARY_ACCESS_CODE: a long, unique password you choose for this chatbot.

    Enter the API key only in Cloudflare's Secret field. Never put it in the code, this page, or chat.
  4. Save and deploy the updated settings. The default model is gpt-6-astra. If your API project cannot access that model, add a variable called OPENAI_MODEL with an available Responses API model ID.
  5. Confirm API billing is enabled in your OpenAI account. API usage costs are separate from ChatGPT.
  6. Copy your Worker's https://….workers.dev address. Return to garyai, click Connection, paste that address, and enter your GARY_ACCESS_CODE when prompted. The OpenAI API key stays in Cloudflare.
  7. Send a short test message. If there is an error, tell us the error text only. The address is saved in this browser; the access code lasts for this browser session. Repeat Connection setup on another device.

This version supports text conversations, writing, math, and coding assistance. It does not include web browsing, file uploads, image generation, or code execution. The external Worker uses a shared access code and a basic 10-request-per-minute limit per running instance; do not distribute the access code publicly.