ChatGPT Adapter

This service integrates the chat reverse interfaces of multiple AIs, including OpenAI API, Coze, DeepSeek, Cursor, Windsurf, BlackBox, You, Grok, Bing Image Drawing, and more, adapting them to the OpenAI API standard interface server.

image

For specific configurations, please » consult the documentation »

Supports high-speed streaming output, multi-turn conversations, and is fully compatible with the ChatGPT interface.

By using this project, you can enjoy the following content converted to the v1 interface:

Server-less Automated Program Download

Download Link

After downloading, extract bin.zip and place it in the same directory as your project.

IOC SDK Example Project

iocgo/sdk


Pre-execution Steps

Pre-execution Guide

Install the intermediate compilation tool:

1
2
3
4
5
go install ./cmd/iocgo

# or 

make install

Usage

Usage Guide

Attach additional commands to standard Go commands:

# ----- go build ------ #
# Original command #
go build ./main.go

# Modified command #
go build -toolexec iocgo ./main.go


# ----- go run ------ #
# Original command #
go run ./main.go

# Modified command #
go run -toolexec iocgo ./main.go

Other go commands follow the same pattern.


Running This Project in Three Steps (Linux / macOS / Windows)

Execution Guide

1
2
3
4
5
6
7
8
# Step 1: Install
make install

# Step 2: Compile
make

# Step 3: Start
./bin/linux/server config.yaml

TIPS:

  • If config.yaml is not specified at startup, it will default to the same directory.
  • You can specify a network configuration file:
    ./bin/linux/server https://file.example.com/config.yaml
    
  • You can set a global environment variable:
    CONFIG_PATH
    

Create a config.yaml file:

server:
  port: 8080
  proxied: http://127.0.0.1:7890
  password: 'xxx'
  think_reason: true
  debug: false

browser-less:
  enabled: true
  port: 8081
  #reversal: http://127.0.0.1:8081
  disabled-gpu: true
  headless: new

custom-llm:
  - prefix: custom
    proxied: true
    reversal: https://models.inference.ai.azure.com
  - prefix: grok
    proxied: true
    reversal: https://api.x.ai/v1

matcher:
  - match: I do not engage
    over: ":\n"
    notice:
    regex: |
      "(?i)I do not engage .+:\n":""
  - match: <thinking>
    over: </thinking>
    notice:
    think_reason: true
    regex: |
      "(?s)<thinking>(.+)</thinking>":"$1"

Server Configuration

Server Configuration Guide

  • port → Server startup port
  • proxied → Local proxy
  • password → Access password (can also be set via the global variable PASSWORD).
    • Effective for AI models like coze and you that use cookie-based authentication.
    • Not applicable for AI models requiring authorization headers.
  • think_reason → Enables compatibility with the reasoning_content field in DeepSeek model responses.

Browser-less Automation Configuration

Browser-less Configuration Guide

  • enabled → Enable or disable browser automation
  • port → Data request port
  • reversal → Access address when browser automation service is separated (alternative to enabled)
  • disabled-gpu → Disable GPU acceleration
  • headless → Headless mode options: true / false / new

Custom LLM v1 Bridge

Custom LLM Configuration Guide

  • prefix → Model prefix (e.g., ${prefix}/gpt4o)
  • reversal → LLM target address

Matcher: Response Token Filter

Matcher Configuration Guide

  • match → Start pattern for text block matching
  • over → End pattern for text block matching
  • notice → If a match is found, a specified string is sent to the frontend (ignored if empty)
  • think_reason → Enables structured reasoning format
  • regex → Regular expression processing for matched content

!!! Deprecated !!!
The opposing site has discontinued free usage and switched to credit card verification. It cannot be used without binding a credit card.

Configuration Instructions

1
2
3
4
blackbox:
  token: '00f37b34-a166-4efb-bce5-1312d87f2f94'
  model:
    - 'xxx'

TIPS: This key is currently fixed

Model List

1
2
3
4
5
[
    "blackbox/GPT-4o",
    "blackbox/Gemini-PRO",
    "blackbox/Claude-Sonnet-3.5"
]

Request Example

curl -i -X POST   -H "Content-Type: application/json"   -H "Authorization: ${authorization}"   -d'{
  "stream": true,
  "model": "blackbox/GPT-4o",
  "messages": [
    {
      "role":    "user",
      "content": "hi ~"
    }
  ]
}' 'http://127.0.0.1:8080/v1/chat/completions'

Available Parameters:

1
2
3
4
5
{
    "temperature": [0.0~1.0],
    "max_tokens": [0.0~1.0],
    "top_p": [0.0~1.0]
}

COZE

Configuration Instructions

1
2
3
4
5
6
7
8
9
coze:
  websdk:
    model: claude-35-sonnet-200k
    system: xxx
    bot: custom-assistant
    accounts:
      - email: xxx@gmail.com
        password: xxx
        validate: xxx@gmail.com
  • accounts: These are Gmail login email addresses. Only accounts that can log in by entering the email for verification are available. Human verification is not implemented. Requires a high network bandwidth.
  • Available model options:
    • claude-35-sonnet-200k
    • claude-35-haiku-200k
    • gpt4o-8k
    • gpt4o-32k
    • gpt4o-128k
    • gpt4-125k
    • gpt35-16k

You can also deploy on coze.com. After deploying the web SDK, obtain the bot_id and concatenate it into the string coze/{bot_id}-xxxxx-1000-w. The string coze/{bot_id}-xxxxx-1000-w will be your model parameter.

Model List

1
2
3
4
[
    "coze/websdk",
    "coze/{bot_id}-xxxx-1000-w"
]

Request Example

curl -i -X POST   -H "Content-Type: application/json"   -H "Authorization: ${authorization}"   -d'{
  "stream": true,
  "model": "coze/websdk",
  "messages": [
    {
      "role":    "user",
      "content": "hi ~"
    }
  ]
}' 'http://127.0.0.1:8080/v1/chat/completions'

Available Parameters:

None

CURSOR:

Configuration Instructions

cursor:
  checksum: 'zo-v9_v2qxRYcau35NDnAHAVxQkLe6IHw8opkpKV4oLyo0PhPeSpj4QTw2VJ20Lngrz7XNTQ/clDRF5FOm3B1uK-mQDyFBRqD8JNj4kLByaAfm4AqK6IMbFYcrqXMMXexubsTRrr1'

TIPS:
This key serves as the device ID and is generated randomly. If not configured, one will be automatically generated.


Model List

[
    "cursor/claude-3-5-sonnet-20241022",
    "claude-3.7-sonnet",
    "claude-3.7-sonnet-thinking",
    "cursor/claude-3-opus",
    "cursor/claude-3.5-haiku",
    "cursor/claude-3.5-sonnet",
    "cursor/cursor-small",
    "cursor/gpt-3.5-turbo",
    "cursor/gpt-4",
    "cursor/gpt-4-turbo-2024-04-09",
    "cursor/gpt-4o",
    "cursor/gpt-4o-mini",
    "cursor/o1-mini",
    "cursor/o1-preview"
]

Request Example

TIPS:
authorization refers to the WorkosCursorSessionToken cookie obtained after logging into the website.

curl -i -X POST   -H "Content-Type: application/json"   -H "Authorization: ${authorization}"   -d'{
  "stream": true,
  "model": "cursor/gpt-3.5-turbo",
  "messages": [
    {
      "role":    "user",
      "content": "hi ~"
    }
  ]
}' 'http://127.0.0.1:8080/v1/chat/completions'

Available Parameters:

None

WINDSURF

Configuration Description

windsurf:
  proxied: false

proxied: Whether to use a proxy

Model List

[
    "windsurf/claude-3-5-sonnet",
    "claude-3-7-sonnet",
    "claude-3-7-sonnet-think",
    "windsurf/gpt4o",
    "windsurf/deepseek-chat",
    "windsurf/deepseek-reasoner",
    "windsurf/gpt4-o3-mini",
    "windsurf/gemini-2.0-flash"
]

Request Example

TIPS: After logging into the website, visit https://codeium.com/profile?referrer=extension and press F12 to open the developer tools. In the Network panel, locate the request to https://web-backend.codeium.com/exa.user_analytics_pb.UserAnalyticsService/GetAnalytics and find the x-api-key in the request headers for the authorization value.

curl -i -X POST   -H "Content-Type: application/json"   -H "Authorization: ${authorization}"   -d'{
  "stream": true,
  "model": "windsurf/gpt4o",
  "messages": [
    {
      "role": "user",
      "content": "hi ~"
    }
  ]
}' 'http://127.0.0.1:8080/v1/chat/completions'

Available Parameters:

1
2
3
4
5
{
    "MaxTokens",
    "TopK",
    "TopP"
}

YOU

Configuration Instructions

you:
  custom: true
  task: false
  model:
    - 'xxx'
  cookies:
    - '_ga_2N7ZM9C56V=GS1.1.1732301239.1.1.1732301254.0.0.1111759234; you_subscription=freemium; ab.storage.userId.dcee0642-d796-4a7b-9e56-a0108e133b07=g%3AU2pDWigjrIDXMZPvlmrSOdSQS0yG%7Ce%3Aundefined%7Cc%3A1732301254524%7Cl%3A1732301254526; DSR=eyJhbGciOiJSUzI1NiIsImtpZCI6IlNLMmpJbnU3SWpjMkp1eFJad1psWHBZRUpQQkFvIiwidHlwIjoiSldUIn0.eyJhbXIiOlsiZW1haWwiXSwiYXV0aDBJZCI6bnVsbCwiZHJuIjoiRFNSIiwiZW1haWwiOiJwZm51dW1ra0BzaGFya2xhc2Vycy5jb20iLCJleHAiOjE3NjM3NTA4NTQsImdpdmVuTmFtZSI6IiIsImlhdCI6MTczMjMwMTI1NCwiaXNzIjoiUDJqSW50dFJNdVhweVlaTWJWY3NjNEM5WjBSVCIsImxhc3ROYW1lIjoiIiwibmFtZSI6IiIsInBpY3R1cmUiOiIiLCJzdHl0Y2hJZCI6bnVsbCwic3ViIjoiVTJwRFdpZ2pySURYTVpQdmxtclNPZFNRUzB5RyIsInRlbmFudEludml0YXRpb24iOm51bGwsInRlbmFudEludml0ZXIiOm51bGwsInVzZXJJZCI6IlUycERXaWdqcklEWE1aUHZsbXJTT2RTUVMweUciLCJ2ZXJpZmllZEVtYWlsIjp0cnVlfQ.XycIIb-rNopCToOzWdEHmkOmN1_XI1Qcli_BSrpAjjvEteZUoWrnzRwh-lg6dny2uKcJfee_DeH5j084HjrusteolFy30YEkiDmHd70D3Dndn4-FmRcWym9bI99i0QnP7krthDK9e4S8h9fLk94ipsQHIy9LJnBPGs0ycE9eUZpwYthHPgE7lysKOtc_lgE6q-pDdn2ZbJMhQuoB-PTaNOfXt4AkDz1nm4Qec2P0CamNMp1ZPnIpHz7mcPUwBdPII0L0fJl2aUI6eVUkvYIB-3MY_ha6M22M0Ilxtp0ci1X6Z1JByC2FARbTFdGuJtkvesV25ohKZ757zwX7kYhQCg; _gtmeec=eyJjdCI6IjBhNDk5MmVhNDQyYjUzZTNkY2E4NjFkZWFjMDlhOGQ0OTg3MDA0YTg0ODMwNzliMTI4NjEwODBlYTRhYTFiNTIiLCJzdCI6IjE5OGRlYTM5MmFmYzIxZDA3MGY4YWJmYzdjMDZkMTEwNjBmMWIyNzhlNWQ2MjUwMWJkNTdmMTE1OWE3MmViYWMiLCJ6cCI6IjhmOTFkMmI2NTgzNWUyYjcyMzFiYmM2ODNkOTVlNzk3MmI4MWRiZjQ3Yjc5ZjljZDM2N2ZkOGIwMWVmZDA5ZWYiLCJjb3VudHJ5IjoiNzlhZGIyYTJmY2U1YzZiYTIxNWZlNWYyN2Y1MzJkNGU3ZWRiYWM0YjZhNWUwOWUxZWYzYTA4MDg0YTkwNDYyMSJ9; _clsk=16fr0b0%7C1732301240090%7C1%7C0%7Cq.clarity.ms%2Fcollect; AF_DEFAULT_MEASUREMENT_STATUS=true; _gcl_au=1.1.93543382.1732301240; FPAU=1.1.93543382.1732301240; daily_query_date=Fri%20Nov%2022%202024; _ga=GA1.1.1950293868.1732301240; ab.storage.deviceId.dcee0642-d796-4a7b-9e56-a0108e133b07=g%3A917c796c-a9d5-8b2b-6faa-e6aec5674206%7Ce%3Aundefined%7Cc%3A1732301239546%7Cl%3A1732301254526; _clck=10u8ms5%7C2%7Cfr3%7C0%7C1787; youpro_subscription=false; daily_query_count=0; ab.storage.sessionId.dcee0642-d796-4a7b-9e56-a0108e133b07=g%3A5ad53bdc-bdb9-676e-6b53-5f181d5d1597%7Ce%3A1732303054530%7Cc%3A1732301254525%7Cl%3A1732301254530; FPID=FPID2.2.IMMix8nfVFnmJzQQdw%2BMkXZ4VzY%2BDMo%2BcaN8ZTpZ7Pg%3D.1732301240; DS=eyJhbGciOiJSUzI1NiIsImtpZCI6IlNLMmpJbnU3SWpjMkp1eFJad1psWHBZRUpQQkFvIiwidHlwIjoiSldUIn0.eyJhbXIiOlsiZW1haWwiXSwiYXV0aDBJZCI6bnVsbCwiZHJuIjoiRFMiLCJlbWFpbCI6InBmbnV1bWtrQHNoYXJrbGFzZXJzLmNvbSIsImV4cCI6MTczNDcyMDQ1NCwiZ2l2ZW5OYW1lIjoiIiwiaWF0IjoxNzMyMzAxMjU0LCJpc3MiOiJQMmpJbnR0Uk11WHB5WVpNYlZjc2M0QzlaMFJUIiwibGFzdE5hbWUiOiIiLCJuYW1lIjoiIiwicGljdHVyZSI6IiIsInJleHAiOiIyMDI1LTExLTIxVDE4OjQ3OjM0WiIsInN0eXRjaElkIjpudWxsLCJzdWIiOiJVMnBEV2lnanJJRFhNWlB2bG1yU09kU1FTMHlHIiwidGVuYW50SW52aXRhdGlvbiI6bnVsbCwidGVuYW50SW52aXRlciI6bnVsbCwidXNlcklkIjoiVTJwRFdpZ2pySURYTVpQdmxtclNPZFNRUzB5RyIsInZlcmlmaWVkRW1haWwiOnRydWV9.X1Tz7tV1tbSre0MUn_QES9cj9bbZjow75OKAvpODpM9kxGwOpajW3tdZm7sCVAyJUHtsJN6QN4R2OJExnzBf8_keKoAvXeDZ3llXLNc966C3YqFwm4o-5XFSJI7FKZW6cWRAyZxnkL4B4QtNZ5YZKAXk5Ft_8w0xCFIybn4WBcUAc9xeNFG-ukMY0qF0SDlYPSG1Lgx5Q2pDO-4boFAzV6QXV4H3rDiAdRstw_ceOeMS-77GsvP2-ERVRTAFIqxZwgCf8oXfnQ1vRqJOj2Vtd6d6LNsWq67lmed3Molm5FQ2_pn-Q_kPSTrLwFrcDXxzniiUCwGGu2mI8or1duPGmw; AF_SYNC=1732301240466; youchat_smart_learn=true; youchat_personalization=true; ai_model=gpt_4o; FPLC=ysIGegVWcFdg2mWhRCQe5ztvlGU3RGpoTrV0xV7UMyi9%2FtJbqqnXVRSekj%2FwdvETj2zQNlZ7BysjI%2F8elp7Tz0F57SiNSSPMIcxQoIJKav6Zxp0vRrWvkd2%2BQo0GVA%3D%3D; ld_context=%7B%22kind%22%3A%22user%22%2C%22key%22%3A%22ba1ebcd6-b741-43b7-abef-4f223a037b89%22%2C%22email%22%3A%22UNKNOWN%22%2C%22country%22%3A%22US%22%2C%22userAgent%22%3A%22Mozilla%2F5.0%20(X11%3B%20Linux%20x86_64)%20AppleWebKit%2F537.31%20(KHTML%2C%20like%20Gecko)%20Chrome%2F125.0.0.0%20Safari%2F537.36%20Edg%2F125.0.0.0%22%2C%22secUserAgent%22%3A%22%5C%22Microsoft%20Edge%5C%22%3Bv%3D%5C%22131%5C%22%2C%20%5C%22Chromium%5C%22%3Bv%3D%5C%22131%5C%22%2C%20%5C%22Not_A%20Brand%5C%22%3Bv%3D%5C%2224%5C%22%22%7D; uuid_guest_backup=1c0d441b-f25e-48f3-994d-cf98347a5275; uuid_guest=1c0d441b-f25e-48f3-994d-cf98347a5275; total_query_count=0; safesearch_guest=Moderate; afUserId=236f85d2-32da-4667-96f4-3fac36968ba2-p; FPGSID=1.1732301240.1732301240.G-WYGVQX1R23.CqhJy8e5kTR0fNgk7GzAqQxxxx'
task: Timer for Cloudflare verification

custom: Start custom models; they will be created automatically if they do not exist
```yaml

**Model List**
```json
[
    "you/gpt_4",
    "you/gpt_4o",
    "you/gpt_4o_mini",
    "you/gpt_4_turbo",
    "you/openai_o1",
    "you/openai_o1_mini",
    "you/claude_2",
    "you/claude_3_haiku",
    "you/claude_3_sonnet",
    "you/claude_3_5_sonnet",
    "you/claude_3_opus",
    "you/gemini_pro",
    "you/gemini_1_5_pro",
    "you/gemini_1_5_flash"
]

Request Example

curl -i -X POST   -H "Content-Type: application/json"   -H "Authorization: ${authorization}"   -d'{
  "stream": true,
  "model": "you/gpt_4",
  "messages": [
    {
      "role":    "user",
      "content": "hi ~"
    }
  ]
}' 'http://127.0.0.1:8080/v1/chat/completions'

Available Parameters:

None
```

Notes:

  • Configuration Instructions: Provides details on how to set up the configuration, including custom settings, task scheduling, models, and cookies.
  • Model List: Lists the available AI models that can be used.
  • Request Example: Demonstrates how to make a request to the API using curl.
  • Available Parameters: Indicates that there are no additional parameters available for customization.
Edit Report
Pub: 01 Mar 2025 18:46 UTC
Views: 564