Endpoint
POST http://AGDEV_IP:9920/v1/chat/completions
Provider Selection
Set the model field to one of: chatgpt, claude, gemini, deepseek.
Each provider must be logged in via the dashboard first.
Example: curl
curl -X POST http://AGDEV_IP:9920/v1/chat/completions -H "Content-Type: application/json" -d '{model:chatgpt,messages:[{role:user,content:Hello}],stream:false}'
Example: streaming
curl -X POST http://AGDEV_IP:9920/v1/chat/completions -H "Content-Type: application/json" -d '{model:chatgpt,messages:[{role:user,content:Hello}],stream:true}'
OpenAI-compatible
This API uses the same format as OpenAI. Use it with any tool that supports OpenAI API by setting the base URL to http://AGDEV_IP:9920/v1.
Models endpoint
GET http://AGDEV_IP:9920/v1/models returns list of connected providers.
Adding a Custom Provider
To add a new provider, you need three CSS selectors:
- Input selector - targets the chat input field
- Send button selector - targets the send button
- Response selector - targets the assistant response text
How to find selectors using Chrome DevTools
- Open the provider website in Chrome
- Right-click the chat input field → Inspect
- Look for a unique attribute like placeholder, id, or class
- Right-click the send button → Inspect
- Look for aria-label, type="submit", or a unique class
- Right-click a response message → Inspect
- Look for a container that wraps the response text
Example selectors
| Element | Example Selector |
|---|---|
| Input | textarea[placeholder="Type a message..."] |
| Input | div[contenteditable="true"]:not(.ql-clipboard) |
| Send | button[type="submit"] |
| Send | button[aria-label*="Send"] |
| Response | .message-content .text |
| Response | .prose p |
Tips
- Use unique attributes (placeholder, aria-label, data-testid) for better reliability
- Avoid classes with random suffixes (they change on each deploy)
- Test your selector in the browser console:
document.querySelector("your-selector")