whatisgithub

What is claude2api?

aurora-develop/claude2api — explained in plain English

Analysis updated 2026-05-18

27GoAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A small Go service that lets your app talk to the claude.ai website as if it were an official API, forwarding OpenAI-style requests through your logged-in web session.

Mindmap

mindmap
  root((Claude2api))
    What it does
      Bridges apps to claude.ai
      Accepts OpenAI-style requests
      Returns streaming or full replies
    How it connects
      Needs your claude.ai login
      Uses session key or cookies
      Mimics a real browser
    Endpoints
      Chat completion
      Anthropic message format
      Model list
    Running it
      Go 1.26.4 or Docker
      Config via environment variables
      Temporary web sessions per request
    Limitations
      Only fixed model names
      Token counts are estimates
      No official API needed
    Audience
      Developers bridging chat
      Self-hosters
      API tinkerers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Use claude.ai from an app that already speaks the OpenAI chat format without an official API key.

USE CASE 2

Build a multi-turn chatbot backed by your claude.ai web session with persistent conversation support.

USE CASE 3

Self-host a bridge service on your own server using Docker Compose to route requests to claude.ai.

What is it built with?

GoDockerDocker Compose

How does it compare?

aurora-develop/claude2apiaasixh/devgrepkamalyes/go-argus
Stars272727
LanguageGoGoGo
Setup difficultymoderateeasyeasy
Complexity3/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a valid claude.ai browser session key or full cookie string, plus either Go 1.26.4+ or Docker.

No license information is provided in the repository, so usage rights are unclear.

So what is it?

Claude2api is a small service written in the Go programming language that acts as a middleman between your application and the claude.ai website. Instead of calling an official developer API, it takes requests in common formats used by OpenAI and Anthropic, forwards them to the claude.ai web interface, and passes the answers back. You need an existing claude.ai browser session for it to work, since the service relies on your login credentials to reach Claude through its normal web pages. The project mimics a real web browser when contacting claude.ai. It sends matching security settings, headers, and cookies so the upstream site treats the traffic like a normal visitor. You can authenticate in two ways: by providing just a session key, which is simpler but less precise, or by pasting a full set of browser cookies, which closely matches real browser behavior. Certain security cookies from services like Cloudflare are never faked or forwarded in the simpler mode. It exposes several familiar endpoints, including chat completion and message interfaces that match OpenAI and Anthropic conventions, plus a model list endpoint. Responses can come back all at once or as a streaming event feed. A persistent conversation mode keeps multi-turn chats connected. Only a fixed set of Claude model names are accepted, and anything else returns an error. Running it requires Go 1.26.4 or later, or you can use the provided Docker image and Docker Compose setup. Configuration is handled through environment variables for the port, upstream URL, session key, full cookie string, timezone, locale, and default model. Each request creates a temporary claude.ai session and tries to delete it afterward. Token counts in the usage data are rough estimates based on output length. The project does not appear to have a detailed description on GitHub beyond the README itself.

Copy-paste prompts

Prompt 1
Help me set up Claude2api with Docker Compose and configure the environment variables for my claude.ai session key and default model.
Prompt 2
Show me how to call the Claude2api chat completion endpoint from a Python script using the OpenAI SDK, pointing the base URL at my local Claude2api server.
Prompt 3
Explain how to grab the full cookie string from my claude.ai browser session so I can paste it into Claude2api for more reliable authentication.
Prompt 4
Walk me through enabling streaming responses from Claude2api so I can display Claude replies token-by-token in my app's chat interface.

Frequently asked questions

What is claude2api?

A small Go service that lets your app talk to the claude.ai website as if it were an official API, forwarding OpenAI-style requests through your logged-in web session.

What language is claude2api written in?

Mainly Go. The stack also includes Go, Docker, Docker Compose.

What license does claude2api use?

No license information is provided in the repository, so usage rights are unclear.

How hard is claude2api to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is claude2api for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.