# Introduction OpenAI API Proxy

**URL:** <https://community.openai.com/t/introduction-openai-api-proxy/920452>\
**Category:** Community\
**Tags:** chatgpt, project\
**Created:** [August 24, 2024, 1:55pm UTC](https://community.openai.com/t/introduction-openai-api-proxy/920452 "2024-08-24T13:55:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rxliuli](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/rxliuli/32/45301_2.png) [@rxliuli](https://community.openai.com/u/rxliuli)\
**Post date:** [August 24, 2024, 1:55pm UTC](https://community.openai.com/t/introduction-openai-api-proxy/920452/1 "2024-08-24T13:55:53Z")

</div>

Provides the same proxy OpenAI API interface for different LLM models, and supports deployment to any Edge Runtime environment.

Supported models

- OpenAI
- Anthropic
- Google Vertex Anthropic
- Google Gemini
- DeepSeek

## Deployment

[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/rxliuli/openai-api-proxy)

Environment variables

- `API_KEY`: Proxy API Key, required when calling the proxy API

- OpenAI: Supports OpenAI models, e.g. `gpt-4o-mini`

- VertexAI Anthropic: Supports Anthropic models on Google Vertex AI, e.g. `claude-3-5-sonnet@20240620`

- Anthropic: Supports Anthropic models, e.g. `claude-3-5-sonnet-20240620`

- Google Gemini: Supports Google Gemini models, e.g. `gemini-1.5-flash`

## Usage

Once deployed successfully, you can call different models through OpenAI’s API interface.

For example, calling OpenAI’s API interface:

```bash
curl http://localhost:8787/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d '{
     "model": "gpt-4o-mini",
     "messages": [
       {
         "role": "user",
         "content": "Hello, world!"
       }
     ]
   }'

```

Or calling Anthropic’s API interface:

```bash
curl http://localhost:8787/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d '{
     "model": "claude-3-5-sonnet-20240620",
     "messages": [
       {
         "role": "user",
         "content": "Hello, world!"
       }
     ]
   }'

```

And it can be used in OpenAI’s official SDK, for example:

```ts
const openai = new OpenAI({
  baseURL: 'http://localhost:8787/v1',
  apiKey: '$API_KEY',
})

const response = await openai.chat.completions.create({
  model: 'gpt-4o-mini',
  messages: [{ role: 'user', content: 'Hello, world!' }],
})

console.log(response)

```

## See GitHub: [GitHub - rxliuli/llm-api-proxy: Provides the same proxy OpenAI API interface for different LLM models, and supports deployment to any Edge Runtime environment.](https://github.com/rxliuli/openai-api-proxy)

I’m not sure if it’s appropriate to post here. If it’s not, I will delete it.

---

<div class="post-metadata">

**Author:** ![edotservice](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/edotservice/32/447241_2.png) [@edotservice](https://community.openai.com/u/edotservice)\
**Post date:** [August 24, 2024, 2:43pm UTC](https://community.openai.com/t/introduction-openai-api-proxy/920452/2 "2024-08-24T14:43:08Z")

</div>

I don’t know about whether you should or not, but you gave me chance to know deepseek. Seems promising. Spent 10 minutes mainly testing out, didnt seems bad. Claim on the site is too much specially with math and mainly most of the AI get math always wrong and they are claiming otherwise. I will definitely check claims.

---

<div class="post-metadata">

**Author:** ![rxliuli](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/rxliuli/32/45301_2.png) [@rxliuli](https://community.openai.com/u/rxliuli)\
**Post date:** [August 25, 2024, 7:42am UTC](https://community.openai.com/t/introduction-openai-api-proxy/920452/3 "2024-08-25T07:42:50Z")

</div>

Update 2024-08-24

- Support for DeepSeek models
- Anthropic models support image input

 ![image](https://us1.discourse-cdn.com/openai1/original/4X/4/1/5/415df4e5d7265d92b6ef5188d0ec19270b546c95.png)  
 ![image](https://us1.discourse-cdn.com/openai1/original/4X/9/2/c/92ce111488b5d9044ff53765cda021ff3bb909da.png)

---

<div class="post-metadata">

**Author:** ![rxliuli](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/rxliuli/32/45301_2.png) [@rxliuli](https://community.openai.com/u/rxliuli)\
**Post date:** [September 8, 2024, 6:51am UTC](https://community.openai.com/t/introduction-openai-api-proxy/920452/4 "2024-09-08T06:51:42Z")

</div>

It has been a while since the last release, and the new version supports more models

- Groq
- Cerebras
- Azure OpenAI
- Cohere

 ![image](https://us1.discourse-cdn.com/openai1/original/4X/3/7/2/3725fc08516eceaeed231bdb2e665146c214b607.png)

---

<div class="post-metadata">

**Author:** ![melvin](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/melvin/32/512474_2.png) [@melvin](https://community.openai.com/u/melvin)\
**Post date:** [January 11, 2025, 12:29am UTC](https://community.openai.com/t/introduction-openai-api-proxy/920452/5 "2025-01-11T00:29:00Z")

</div>

Exactly what I was looking for (OpenAI API Proxy with DeepSeek support), thanks!
