50

API Documentation

Chat API

POST /api/gpt4_post.php

{
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Hello, give me an example reply."}
  ],
  "seed": 101
}

GET /api/gpt4_get.php

?message=Hello+give+me+an+example+reply

Image Generation API

POST /api/image.php

{
  "prompt": "a robot image",
  "width": 512,
  "height": 512,
  "steps": 40
}

Example Usage

PHP

// Download example.txt for full PHP example

cURL

curl -X POST https://libreapis.com/api/gpt4_post.php \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"Hello"}]}'