Skip to content

Getting Started

The FOTOhub API is a unified creative AI platform providing access to 80+ state-of-the-art AI models through a single, consistent interface. Generate images, create videos, compose music, run chat completions, analyze content, manage storage, and orchestrate compute workflows — all with one API key and one billing system.

Platform Overview

FOTOhub consolidates dozens of AI providers into a single REST API with unified authentication, billing, and response formats. Instead of managing separate accounts with multiple providers, you integrate once and gain access to everything.

Available Services

ServiceDescriptionModels
Image GenerationText-to-image, image-to-image, inpaintingSeedDream, FLUX, MAI-Image, Imagen 4, DALL-E, Grok Imagine
Video GenerationText-to-video, image-to-video, video extensionVeo 3, Sora 2, Kling, WAN, Seedance, Hailuo
Music & AudioMusic generation, sound effects, audio-to-audioIDA Music, MiniMax
3D GenerationImage-to-3D, text-to-3D, GLB/OBJ/STL exportFH Lite 3D, FH Pro 3D
Chat & TextCompletions, reasoning, summarizationClaude, GPT-4o, Gemini, DeepSeek
Analysis & VisionImage analysis, OCR, captioningMulti-modal LLMs
Text-to-SpeechVoice synthesis, voice cloningIDA Voice
Speech-to-TextTranscription, translationWhisper variants
Image EditingUpscaling, background removal, style transferSpecialized editing models
Storage & ComputeFile management, agent workflowsPlatform services

Base URL

All API requests are made to the following base URL. Every endpoint is prefixed with /v1/ to ensure versioning compatibility.

https://apis.fotohub.app/v1/
EnvironmentURL
Productionhttps://apis.fotohub.app/v1/
Console APIhttps://apis.fotohub.app/v1/console/

API Versioning

All current endpoints use the /v1/ prefix. When breaking changes are introduced, a new version prefix (e.g., /v2/) will be released. The previous version will remain available for at least 12 months after deprecation notice.

Quick Start

Get up and running with the FOTOhub API in three steps. You can make your first generation in under 60 seconds.

Step 1: Get Your API Key

Navigate to fotohub.app/console and open the Keys tab. Click "Create New Key" to generate a production key (prefixed with fh_live_) or a sandbox key (prefixed with fh_test_). Copy the key immediately — it will not be shown again.

Key Security

Your API key grants access to billable resources. Store it securely in environment variables or a secrets manager. Never commit keys to source control or expose them in client-side code.

Step 2: Make Your First Request

Generate an image using SeedDream 5.0 Lite. The response includes the generated image URL and billing details.

python
import requests

response = requests.post(
    "https://apis.fotohub.app/v1/ai/generate/image",
    headers={
        "Authorization": "Bearer fh_live_your_api_key_here",
        "Content-Type": "application/json"
    },
    json={
        "model": "seedream-5-0-260128",
        "prompt": "A futuristic cityscape at sunset, photorealistic",
        "width": 1024,
        "height": 1024,
        "steps": 25
    }
)

result = response.json()
print(f"Image URL: {result['url']}")
print(f"Credits used: {result['billing']['credits_used']}")
typescript
const response = await fetch(
  "https://apis.fotohub.app/v1/ai/generate/image",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer fh_live_your_api_key_here",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model: "seedream-5-0-260128",
      prompt: "A futuristic cityscape at sunset, photorealistic",
      width: 1024,
      height: 1024,
      steps: 25,
    }),
  }
);

const result = await response.json();
console.log(`Image URL: ${result.url}`);
console.log(`Credits used: ${result.billing.credits_used}`);
bash
curl -X POST https://apis.fotohub.app/v1/ai/generate/image \
  -H "Authorization: Bearer fh_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedream-5-0-260128",
    "prompt": "A futuristic cityscape at sunset, photorealistic",
    "width": 1024,
    "height": 1024,
    "steps": 25
  }'

Step 3: Check Your Balance

Verify your remaining credits and wallet balance to ensure you have sufficient funds for continued usage.

python
response = requests.get(
    "https://apis.fotohub.app/v1/billing/balance",
    headers={"Authorization": "Bearer fh_live_your_api_key_here"}
)

balance = response.json()
print(f"Credits remaining: {balance['credits']['remaining']}")
print(f"Wallet balance: {balance['wallet']['balance']} PLN")
typescript
const response = await fetch(
  "https://apis.fotohub.app/v1/billing/balance",
  {
    headers: {
      "Authorization": "Bearer fh_live_your_api_key_here",
    },
  }
);

const balance = await response.json();
console.log(`Credits remaining: ${balance.credits.remaining}`);
console.log(`Wallet balance: ${balance.wallet.balance} PLN`);
bash
curl https://apis.fotohub.app/v1/billing/balance \
  -H "Authorization: Bearer fh_live_your_api_key_here"

Example response:

json
{
  "tier": "starter",
  "credits": {
    "remaining_4h": 45,
    "remaining_period": 890
  },
  "wallet": {
    "balance": 150.00,
    "currency": "PLN"
  }
}

Authentication Overview

All requests require a Bearer token in the Authorization header:

Authorization: Bearer fh_live_your_api_key_here

Key Types

PrefixEnvironmentDescription
fh_live_ProductionFull access, charges real credits/wallet
fh_test_SandboxLimited models, no billing charges

Required Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token with your API key. Format: Bearer fh_live_* or Bearer fh_test_*
Content-TypestringYesMust be application/json for all requests with a body. multipart/form-data accepted for file uploads.
X-Request-IdstringNoOptional idempotency key. If provided, duplicate requests with the same ID within 24h will return the cached response.
X-Fotohub-VersionstringNoAPI version date string (default: 2026-01-01). Pins your request to a specific API behavior version.

Example Request Structure

http
POST /v1/ai/generate/image HTTP/1.1
Host: apis.fotohub.app
Authorization: Bearer fh_live_abc123def456
Content-Type: application/json
X-Request-Id: req_unique_id_12345

{
  "model": "seedream-5-0-260128",
  "prompt": "A serene mountain landscape",
  "width": 1024,
  "height": 768,
  "steps": 25,
  "guidance_scale": 7.5
}

See Authentication for full details on key types, scopes, rotation, and JWT auth.

Response Format

Every successful API response includes the requested data along with a billing object that details the cost of the operation. This provides full transparency on resource consumption for every request.

Successful Response

json
{
  "id": "gen_8f3k2j1m4n5p",
  "object": "image",
  "created": 1721234567,
  "model": "seedream-5-0-260128",
  "url": "https://s3point.fotohub.app/generations/gen_8f3k2j1m4n5p.png",
  "width": 1024,
  "height": 1024,
  "metadata": {
    "prompt": "A futuristic cityscape at sunset, photorealistic",
    "steps": 25,
    "guidance_scale": 7.5,
    "seed": 4281937562,
    "inference_time_ms": 3420
  },
  "billing": {
    "credits_used": 5,
    "credits_remaining": 495,
    "wallet_charged": 0.00,
    "wallet_balance": 150.00,
    "cost_breakdown": {
      "base_cost": 4,
      "resolution_multiplier": 1.0,
      "steps_multiplier": 1.0,
      "total": 5
    },
    "billing_mode": "credits"
  }
}

Error Response

Error responses follow a consistent structure with an error object:

json
{
  "error": {
    "code": "invalid_parameter",
    "message": "Parameter 'width' must be between 256 and 2048",
    "param": "width",
    "type": "validation_error"
  },
  "request_id": "req_abc123"
}

Billing Overview

FOTOhub uses a dual-mode billing system designed for flexibility.

Credits (Prepaid)

Monthly allowance included with your subscription tier. Credits are consumed first for every billable operation. Unused credits do not roll over to the next billing period.

Wallet (Pay-per-use)

PLN balance that acts as a fallback when credits are exhausted. Top up via card, BLIK, or bank transfer. Charged at per-operation rates.

Billing Priority

Credits are always deducted first. When your monthly credit allowance is exhausted, the system automatically falls back to your wallet balance. Some models (BytePlus SeedDream, AWS Bedrock-routed models) use token-based billing where cost is calculated per input/output token rather than a fixed credit amount per operation.

See Billing & Pricing for full details on credit costs per model, wallet top-up, and invoicing.

Rate Limits

Rate limits are enforced per API key and vary by your tier. Limits are calculated on a per-minute sliding window. When exceeded, requests receive a 429 Too Many Requests response.

TierRequests/MinuteConcurrent JobsMonthly Credits
PAYG Basic303Wallet-funded
PAYG Standard12010Wallet-funded
Developer605500
Startup300205,000
Business1,0005025,000
Enterprise5,000200Unlimited

Rate Limit Headers

Every response includes rate limit headers to help you implement client-side throttling:

HeaderDescription
X-RateLimit-LimitMaximum requests allowed per minute
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix timestamp when the rate limit resets

HTTP Status Codes

The API uses standard HTTP status codes to indicate success or failure.

CodeStatusDescription
200OKRequest succeeded. Response body contains the requested data.
201CreatedResource created successfully. Returned for POST requests that create new entities.
400Bad RequestInvalid request body or parameters. Check the error.param field for specifics.
401UnauthorizedMissing or invalid API key. Verify your Authorization header format.
403ForbiddenAPI key lacks permission for this operation. Check key scopes in your console.
404Not FoundThe requested resource does not exist. Verify the endpoint path and resource ID.
429Rate LimitedToo many requests. Back off and retry after X-RateLimit-Reset.
500Server ErrorInternal server error. Retry with exponential backoff. If persistent, contact support.

Retry Strategy

For 429 and 5xx errors, implement exponential backoff starting at 1 second with a maximum of 5 retries. The SDKs handle this automatically. For 4xx errors (except 429), do not retry — fix the request parameters first.

SDKs

Official SDKs are available for Python and TypeScript/JavaScript. They provide type-safe interfaces, automatic retries, streaming support, and built-in error handling.

Installation

LanguagePackageInstall CommandRequirements
Pythonfotohubpip install fotohubPython 3.8+
TypeScriptfotohubnpm install fotohubNode.js 18+, Deno, edge runtimes

SDK Usage

python
from fotohub import FotohubClient

client = FotohubClient(api_key="fh_live_your_api_key_here")

# Generate an image
image = client.images.generate(
    model="seedream-5-0-260128",
    prompt="A futuristic cityscape at sunset",
    width=1024,
    height=1024
)

print(f"URL: {image.url}")
print(f"Credits used: {image.billing.credits_used}")
typescript
import { FotohubClient } from "fotohub";

const client = new FotohubClient({
  apiKey: "fh_live_your_api_key_here",
});

// Generate an image
const image = await client.images.generate({
  model: "seedream-5-0-260128",
  prompt: "A futuristic cityscape at sunset",
  width: 1024,
  height: 1024,
});

console.log(`URL: ${image.url}`);
console.log(`Credits used: ${image.billing.creditsUsed}`);

SDK Features

  • Automatic retries with exponential backoff for transient errors
  • Type safety with full TypeScript definitions and Python type hints
  • Streaming support for chat completions and long-running generations
  • Async/await via fotohub.AsyncClient (Python) or native promises (TypeScript)
  • Built-in error handling with typed exception classes
  • Request logging and debug mode for development

Next Steps