API Documentation
Integrate Plushify into your applications with our REST API. Generate adorable plushies programmatically.
Authentication
All API requests require authentication using an API key. You can generate API keys from your profile settings.
Include your API key in the Authorization header:
Authorization: Bearer plush_your_api_key_hereKeep your API keys secure. Never expose them in client-side code or public repositories.
Base URL
https://plushify.com/apiEndpoints
/api/test/hello
Simple test endpoint to verify your API key is working correctly.
Response
{
"success": true,
"message": "Hello! Your authentication is working correctly.",
"authenticatedAs": {
"id": "user_abc123",
"name": "John Doe",
"email": "john@example.com",
"credits": 50
},
"timestamp": "2025-01-21T10:30:00Z"
}Example cURL Request
curl -X GET https://plushify.com/api/test/hello \
-H "Authorization: Bearer plush_your_api_key"/api/generate
Transform an image into an adorable plushie design using AI.
Request Body
{
"image": "data:image/jpeg;base64,/9j/4AAQ...", // Base64 encoded image
"subjectType": "person" | "pet" | "object", // Type of subject
"style": "default" | "cute" | "realistic" // Optional style preset
}Response
{
"success": true,
"generationId": "gen_abc123",
"imageUrl": "https://plushify.com/generations/abc123.png",
"creditsUsed": 1,
"creditsRemaining": 49
}Example cURL Request
curl -X POST https://plushify.com/api/generate \
-H "Authorization: Bearer plush_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"image": "data:image/jpeg;base64,/9j/4AAQ...",
"subjectType": "pet"
}'/api/generations/:id
Retrieve details about a specific generation.
Response
{
"id": "gen_abc123",
"status": "completed",
"imageUrl": "https://plushify.com/generations/abc123.png",
"originalImageUrl": "https://plushify.com/originals/abc123.png",
"subjectType": "pet",
"createdAt": "2025-01-21T10:30:00Z"
}/api/generations
List all your generations with pagination support.
Query Parameters
limitNumber of results (default: 20, max: 100)cursorPagination cursor for next pageResponse
{
"generations": [...],
"nextCursor": "cursor_xyz789",
"hasMore": true
}/api/credits
Check your current credit balance.
Response
{
"credits": 50,
"usedThisMonth": 25
}Rate Limiting
API requests are rate limited to ensure fair usage and system stability. Limits vary by endpoint type.
Endpoint Limits:
Rate Limit Headers
X-RateLimit-Limit: Maximum requests allowed
X-RateLimit-Remaining: Requests left in window
X-RateLimit-Reset: Unix timestamp when limit resets
Retry-After: Seconds until retry (429 responses)
Rate limits are enforced per user account. When you exceed a limit, the API returns a 429 status code with a Retry-After header.
Error Handling
The API uses standard HTTP status codes and returns errors in a consistent format.
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "You have exceeded the rate limit. Try again later.",
"retryAfter": 3600
}
}Common Error Codes
400Bad Request - Invalid parameters401Unauthorized - Invalid or missing API key402Payment Required - Insufficient credits429Rate Limit Exceeded500Internal Server ErrorQuick Start Examples
JavaScript / Node.js
const response = await fetch(
'https://plushify.com/api/generate',
{
method: 'POST',
headers: {
'Authorization': 'Bearer plush_...',
'Content-Type': 'application/json'
},
body: JSON.stringify({
image: base64Image,
subjectType: 'pet'
})
}
);
const result = await response.json();
console.log(result.imageUrl);Python
import requests
response = requests.post(
'https://plushify.com/api/generate',
headers={
'Authorization': 'Bearer plush_...',
'Content-Type': 'application/json'
},
json={
'image': base64_image,
'subjectType': 'pet'
}
)
result = response.json()
print(result['imageUrl'])