FREE AI API — INTEGRATION PROMPT Paste everything below into ChatGPT, Claude, Cursor, Copilot or any coding assistant, then describe what you want to build. The assistant will write working code for you. ------------------------------------------------------------------------------------ You are helping me build software that calls a free, keyless AI API. Use ONLY the facts below about the API. Do not ask me for an API key: none exists and none is needed. SERVICE - Name: Free AI API (apiaifree.com) - Base URL: https://api.apiaifree.com/v1 - Authentication: none. No API key, no signup, no account, no billing. If a library insists on a key, pass any non-empty string, for example "free". - Protocol: OpenAI-compatible Chat Completions. Any OpenAI SDK works when you change base_url. - Model name: "free-ai" (any other model name is accepted and mapped to the same model). - CORS: enabled for every origin, so the API can be called straight from browser JavaScript. ENDPOINTS 1. POST https://api.apiaifree.com/v1/chat/completions JSON body: messages (required) array of {"role": "system"|"user"|"assistant", "content": "text"} max_tokens (optional) default 1024, maximum 8192 temperature, top_p, stop, seed, presence_penalty, frequency_penalty (optional) stream (optional) true returns Server-Sent Events in OpenAI chunk format, ending with "data: [DONE]" reasoning (optional) true lets the model think step by step before answering; then set max_tokens to 2000 or more Response: standard OpenAI object; the answer text is choices[0].message.content 2. GET or POST https://api.apiaifree.com/ask?q=YOUR+QUESTION Returns the answer as plain text. Add &format=json for {"answer": "..."}. Optional: &system=INSTRUCTIONS and &max_tokens=NUMBER. Best for shell scripts, spreadsheets and quick tests. 3. POST https://api.apiaifree.com/v1/completions plain text completion with a "prompt" field 4. GET https://api.apiaifree.com/v1/models list of models 5. GET https://api.apiaifree.com/health {"status": "ok"} when the model is up LIMITS AND BEHAVIOUR - No daily quota and no per-key limits. Fair use: at most 8 parallel connections per IP address. - Request body up to 1 MB; all messages together up to 120,000 characters. - Text in, text out. No images, audio or embeddings. - The API is stateless: send the whole conversation in "messages" on every call. - Errors use the OpenAI shape {"error": {"message": "...", "type": "...", "code": 503}}. On 429 or 503 wait 2-5 seconds and retry, at most 3 times, with exponential backoff. - Set the HTTP client timeout to at least 120 seconds. REFERENCE CALLS curl: curl https://api.apiaifree.com/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{"model":"free-ai","messages":[{"role":"user","content":"Hello"}]}' Python (pip install openai): from openai import OpenAI client = OpenAI(base_url="https://api.apiaifree.com/v1", api_key="free") r = client.chat.completions.create(model="free-ai", messages=[{"role": "user", "content": "Hello"}]) print(r.choices[0].message.content) JavaScript (browser or Node 18+): const r = await fetch("https://api.apiaifree.com/v1/chat/completions", { method: "POST", headers: {"Content-Type": "application/json"}, body: JSON.stringify({model: "free-ai", messages: [{role: "user", content: "Hello"}]}) }); const data = await r.json(); console.log(data.choices[0].message.content); One line, plain text: curl "https://api.apiaifree.com/ask?q=Explain+REST+in+one+sentence" RULES FOR YOUR CODE - Never add API key handling, environment variables for keys, or signup steps. - Keep the base URL in one constant so it is easy to change. - Always read the answer from choices[0].message.content and handle the "error" object. - For chat interfaces use stream: true and render tokens as they arrive. - Add the retry with backoff described above. MY TASK (Describe here what you want to build, for example: "a Telegram bot that answers questions", "a Google Sheets function that summarises a cell", "a support chat widget for my website".)