Welcome to the ish API documentation! We’re here to provide you free AI from the depths of Cloudflare's Playground—no keys, no limits, no nonsense. Well, that’s until Cloudflare decides to pull the plug. But for now, let’s just roll with it and have some fun!
POST /chat/v1/completions
Example JSON body:
{ "model": "@cf/meta/llama-3.1-8b-instruct", "system_prompt": "You are a helpful assistant.", "messages": [ {"role": "user", "content": "Hello, how are you?"} ], "temperature": 0.7, "max_tokens": 2048, "stream": false }
We’ve got some super amazing code examples below—feel free to copy them, tweak them, or ignore them entirely!
curl -X POST "http://localhost:5000/chat/v1/completions" \ -H "Content-Type: application/json" \ -d '{ "model": "@cf/meta/llama-3.1-8b-instruct", "system_prompt": "You are a helpful assistant.", "messages": [ {"role": "user", "content": "Hello, how are you?"} ], "temperature": 0.7, "max_tokens": 2048, "stream": false }'
import requests url = "http://localhost:5000/chat/v1/completions" headers = { "Content-Type": "application/json" } data = { "model": "@cf/meta/llama-3.1-8b-instruct", "system_prompt": "You are a helpful assistant.", "messages": [ {"role": "user", "content": "Hello, how are you?"} ], "temperature": 0.7, "max_tokens": 2048, "stream": False } response = requests.post(url, headers=headers, json=data) print(response.json())
const axios = require('axios'); async function sendChat() { const url = "http://localhost:5000/chat/v1/completions"; const headers = { "Content-Type": "application/json" }; const data = { model: "@cf/meta/llama-3.1-8b-instruct", system_prompt: "You are a helpful assistant.", messages: [ { role: "user", content: "Hello, how are you?" } ], temperature: 0.7, max_tokens: 2048, stream: false }; try { const response = await axios.post(url, data, { headers }); console.log(response.data); } catch (error) { console.error(error); } } sendChat();
All these shiny models come straight from Cloudflare’s Playground. Because they’re feeling generous today, you can pick from any of these. But again, if they wake up one morning and decide to shut down the party, well... we’ll be gone. Until then, type away and enjoy.
If you want a live list, just do a cheeky GET /models. No keys, no tokens, no disclaimers (except the one above!). Have fun!