Okay, you’re looking for free API services for acquiring/generating images, right?

I’ve compiled a list of services that cover both generation (AI drawing) and acquisition (image library). These are all public APIs with free credits, and you don’t need to build your own inference service.

## **1. AI Image Generation APIs**
These are AI services similar to Stable Diffusion and DALL·E that can generate images from text.

### 1. **Hugging Face Inference API**
– **Address**: [https://huggingface.co/models](https://huggingface.co/models)
– **Fees**: Minute usage limit applies, but public models are free to use (queueing available)
– **Recommended Free Models**:
– `stabilityai/stable-diffusion-2-1` (high quality, medium speed)
– `runwayml/stable-diffusion-v1-5` (classic and stable)
– `prompthero/openjourney` (artistic style)
– `segmind/SSD-1B` (fast)
– **Call**:
“`
POST https://api-inference.huggingface.co/models/{model_id}
Header: Authorization: Bearer {HF_TOKEN}
Body: {“inputs”: “your prompt”}
“`

### 2. **OpenAI Images API (DALL·E)
– **Address**: [https://platform.openai.com/docs/guides/images](https://platform.openai.com/docs/guides/images)
– **Features**: Supports 1024×1024 generation, with a delicate illustration style
– **Call Example**:
“`
POST https://api.openai.com/v1/images/generations
Header: Authorization: Bearer {OPENAI_API_KEY}
Body: {“prompt”: “a cyberpunk city skyline”, “size”: “512×512”}
“`

### 3. **Pollinations API** (Super Simple Call)
– **Address**: [https://image.pollinations.ai/prompt/{prompt}](https://image.pollinations.ai)
– **Features**: Generate images directly from URL parameters, suitable for quick testing
– **Example**:
“`
https://image.pollinations.ai/prompt/a%20beautiful%20fantasy%20castle
“`

### 4. **DeepAI**
– **Address**: [https://deepai.org/machine-learning-model/text2img](https://deepai.org/machine-learning-model/text2img)
– **Free Quota**: Monthly call limit (registration required)
– **Features**: Provides various model interfaces (cartoon, ultra-high-definition, avatar, etc.)
– **Call**:
“`python
import requests
r = requests.post(

“https://api.deepai.org/api/text2img”,
data={“text”: “beautiful landscape, oil painting”},
headers={“api-key”: “YOUR_API_KEY”}
)
print(r.json())
“`

## **2. Free Stock Image API**
These are used to obtain ready-made high-definition photography, illustrations, and vector images.

### 1. **Unsplash API**
– **Address**: [https://unsplash.com/developers](https://unsplash.com/developers)
– **Free Quota**: 50 requests per hour
– **Features**: High-definition photos, copyright-aware, commercially acceptable
– **Call**:
“`
GET https://api.unsplash.com/photos/random?query=mountain
Header: Authorization: Client-ID {ACCESS_KEY}
“`

### 2. **Pexels API**
– **Address**: [https://www.pexels.com/api/](https://www.pexels.com/api/)
– **Free Quota**: 200 requests per hour
– **Features**: High-definition photos and videos, free for commercial use
– **Call**:
“`
GET https://api.pexels.com/v1/search?query=nature
Header: Authorization: {API_KEY}
“`

### 3. **Pixabay API**
– **Address**: [https://pixabay.com/api/docs/](https://pixabay.com/api/docs/)
– **Free Quota**: 5000 requests per hour
– **Features**: Download vector images, illustrations, videos, and music, and many original images are watermark-free.
– **Call**:
“`
GET https://pixabay.com/api/?key=YOUR_API_KEY&q=cat&image_type=photo
“`

## **III. Summary and Comparison Table**

| Type | API Name | Free Quota | Registration Required | Main Features |
|——|———|———|———|———-|
| Generate | Hugging Face | Free public models, queue | Yes | Multiple model selection |
| Generate | OpenAI DALL·E | Sign-up bonus (limited) | Yes | Detailed style |
| Generate | Pollinations | Unlimited | No | Instant URL |
| Generate | DeepAI | Monthly quota | Yes | Multiple models available |
| Source | Unsplash | 50/hour | Yes | HD photography |
| Source | Pexels | 200/hour | Yes | Photos + videos |
| Source | Pixabay | 5000/hour | Yes | Photos + illustrations + vectors |

My suggestions:
– **If you want raw images/text**: Try Hugging Face first (free but potentially slow). For faster results, try the Pollinations API.
– **If you want stock images**: Use Pixabay (higher quota, more types), and use Unsplash as a backup for HD photography.

If you’d like, I can write a Python “automatic image retrieval function” for you. It allows you to choose between generation mode (AI drawing) or search mode (image library API), and then directly returns an image URL that can be posted to WordPress, allowing you to automatically add images to your posts.
Do you want me to write this for you?