Overseas access: www.kdjingpai.com
Bookmark Us
Current Position:fig. beginning " AI Answers

How to get and use the genspark2api conversation interface?

2025-09-05 1.5 K

The path to the genspark2api dialog interface is/chat/completions, supports both streaming and non-streaming output modes.

Get Cookie:
A valid cookie needs to be obtained before use:
1. Access genspark.ai in your browser developer tools (F12).
2. Initiation of a dialogue
3. Locate the ask request in the Network tab.
4. Copy the cookie value in the request header
(must contain session_id=xxx)

Calling example:
Non-streaming requests:

curl -X POST http://localhost:7055/chat/completions 
-H "Authorization: Bearer 123456"
-H "Content-Type: application/json"
-d '{"model": "gpt-4o", "messages": [{"role": "user", "content": "你好"}]}'

Streaming output is simply a matter of adding the request body to the"stream": trueparameter is sufficient.

Return to Example:
{
"choices": [{"message": {"role": "assistant ", "content": "Hello! How can I help you?"}}]
}

Be careful to useAuthorizationThe header carries the configured API_SECRET and the message body follows the standard dialog format.

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

Top