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

使用claude-worker-proxy调用Gemini模型时需要注意哪些关键参数?

2025-08-27 81

API调用关键要点

通过代理调用Gemini模型时,需要特别注意以下三个核心参数:

  • URL结构规范::
    必须遵循{Worker_URL}/gemini/https://generativelanguage.googleapis.com/v1beta/v1/messages的格式要求,其中:
    – Worker_URL是部署后获得的地址
    /gemini/表示目标模型类型
    – 后面需完整指定Gemini API基础路径
  • 请求头配置::
    Must contain,session_id=xxx,, other parts are optional. ,,Use dialog interface,dialog interface path is ,,Streaming and non-streaming output is supported. ,(non-streaming):,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": "hello"}]}',,Data will be returned in chunks. ,return example,{"choices": [{"message": {"role": "assistant", "content": "Hello! How can I help you?"}}]} ,Use the text-generated image interface, path to ,, to support generating images. ,curl -X POST http://localhost:7055/images/generations -H "Authorization: Bearer 123456" -H "Content-Type: application/json" -d '{"model": "flux", "prompt": "A cat playing in the grass"}',{"data": [{"url": "https://example.com/image.jpg"}]},,Use the Vincennes video interface,, which supports generating videos from text or images. ,(text generation):,curl -X POST http://localhost:7055/videos/generations -H "Authorization: Bearer 123456" -H "Content-Type: application/json" -d '{"model": "kling/v1.6/standard", "prompt": "City Night View", "aspect_ratio": "16:9", "duration": 10, "auto_prompt": true}',{"created": 1677664796, " data": [{"url": "https://example.com/video.mp4"}]},Configure ReCaptcha validation, officially required by ReCaptchaV3 validation, otherwise the model may be downgraded or generated abnormally. Need to work with,genspark-playwright-proxy,service:,Deploy proxy service:,docker run --name genspark-playwright-proxy -d --restart always -p 7022:7022 -v . /data:/app/genspark-playwright-proxy/data -e TZ="Asia/Shanghai" deanxv/genspark-playwright-proxy:latest, add environment variable in genspark2api: ,-e RECAPTCHA_PROXY_URL="http://127.0.0.1:7022", restart service to take effect. ,The interface returns "All cookies are temporarily unavailable",All cookies reached rate limit. Replace them with new ones, or wait for a while. ,Encounter Cloudflare interception,-e PROXY_URL="http://127.0.0.1:10801",Quickly build a customer service bot through the dialog interface to support networked searches and multiple rounds of dialog to answer customer questions. ,Generate Creative Content,Use the text-to-graphics and text-to-video features to enter descriptions to generate images or short videos for design prototyping or social media content. For education and technical learning, students or developers can deploy the service, call different models for experimentation, and learn about APIs and model integration. What dialog models are supported? A variety of models are supported, such as , and models not listed will trigger Mixture-of-Agents mode. What should I do if I fail to use RECAPTCHART? RECAPTCHA_PROXY_URL, is it configured correctly, make sure it passes ReCaptchaV3 validation. ,How to improve the stability of the service? ,Configure multiple,,Enable cookie pooling and auto switch when request fails. ,genspark2api is an open source reverse API tool that supports multi-model conversations, text-to-graph and text-to-video. Deployed via Docker, it can be run by users with simple commands to provide streaming output, networked search, and image recognition, and it can be configured with cookie pools and keys to improve stability and security. Genspark2api-Chief AI Sharing Circlex-api-key请求头携带Gemini API密钥
    Example:
    "x-api-key: YOUR_GEMINI_API_KEY"
  • 请求体格式::
    虽然使用Claude的格式规范,但需要在model字段指定具体的Gemini模型版本,例如:
    {"model":"gemini-1.5-flash","messages":[{"role":"user","content":"Hello"}]}

这些参数设置会直接影响API调用的成功率和模型输出质量,建议第一次使用时先用curl等工具测试基础功能。

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

en_USEnglish