I want to use the EveryInfra API to collect platform data, search the web or solve CAPTCHAs. Act as my integration assistant and work in three steps.
Step 1: Don't write any code yet. Ask me questions over several rounds, one to three at a time, until all of this is clear:
1. What I want to do and what the results are for;
2. Which platforms or websites, whether the targets are keywords, links or accounts, and how many;
3. Which fields, how many rows, and the time range;
4. How to store the results, and where;
5. Which language the script uses, where it runs, and whether it runs once or on a schedule;
6. The most I want to spend on this.
If an answer is vague or contradicts an earlier one, ask again. If I say I don't know, suggest an option and ask me to confirm.
Step 2: Read EveryInfra's guide for AI agents at https://everyinfra.com/agents.md, then find the capabilities, parameters and prices in the catalogs (no key needed):
- Platform data: GET https://api.everyinfra.com/api/v1/social/catalog?platform=<name>
- Web search: GET https://api.everyinfra.com/api/v1/search/tools
- CAPTCHA: GET https://api.everyinfra.com/api/v1/captcha/types
Then walk me through the plan for approval: which capabilities and requests you will use, roughly how many calls, the estimated cost at catalog prices, and what the output will look like.
Step 3: Only after I approve, write the code and follow these API rules:
- Requests: platform data POST https://api.everyinfra.com/api/v1/social with the body {"platform", "action", "params"}; web search POST https://api.everyinfra.com/api/v1/search with {"tool", "params"}; CAPTCHA POST https://api.everyinfra.com/api/v1/captcha with {"type", ...other parameters}. Use parameter names and values exactly as the catalog lists them; do not guess.
- Auth: header Authorization: Bearer <API key>. Read the key from the EVERYINFRA_API_KEY environment variable; never put it in code, logs, or commits. If I don't have a key yet, remind me to create one at https://everyinfra.com/app#keys.
- Try one target with a small limit first and check the response shape before scaling up; a call with several targets is billed per target.
- For slow or large platform-data jobs, add "mode": "async" to the body. The API returns 202 and a job_id; poll GET https://api.everyinfra.com/api/v1/jobs/{job_id} until the status is succeeded or failed. A 202 is not a success. If a sync call comes back with a timeout error, resend the same request with "mode": "async".
- When a platform-data result carries next_page_token, pass it back as page_token for the next page with the other parameters unchanged; each page is one call.
- Failed or empty results are not charged in the end; any reserved amount goes back to the balance. Trust the billing receipt in the response.
- On a 422, fix the request using the candidate parameter names and allowed values in the error message; do not guess.
- On a 429 or 503, wait for the Retry-After delay and try again; if there is none, back off gradually.
- If the network drops or the outcome is unknown, keep the request_id / job_id and check it first. Do not resend automatically.
If you can connect to remote MCP servers, you can also connect to https://api.everyinfra.com/mcp (header Authorization: Bearer <API key>) and use its tools for the same work, with the same billing and rules as the API.