Seedance 2.5 from ByteDance is officially available on Apiframe.

DeepAI API: Keys, Requests, Pricing and Limits

Learn how the deepai api works, authenticate requests, generate images with Python, understand pricing, and manage URLs, limits, and scaling.

Renaud Published August 21, 2026 August 21, 2026 · 8 min read
DeepAI API: Keys, Requests, Pricing and Limits

Turning a text prompt into an image only takes one API key and a single request, but a real production app needs more than a quick demo. You need the right header, the right request format, safe key storage, and a plan for image links that don't last forever. This guide covers how the DeepAI API works, where its limits show up, and when a broader option like Apiframe's unified media API makes more sense.

What the DeepAI API Does and How Authentication Works

The DeepAI API gives developers a simple way to call AI features over the web, with image generation as the main feature most small apps use. Right now, the API's main focus is image generation.

Start by creating an account on the DeepAI site. Your developer dashboard gives you an API key, usually shown as a long string of letters and numbers. Treat that key like a password: store it in a server environment variable, never inside a React app or any script that runs in the browser.

The header format matters here. DeepAI expects the key in an api-key header. It doesn't use the more common "bearer token" format you'll see in a lot of other API guides. If you send Authorization: Bearer ... instead, the request can fail even though your key is completely valid.

Image requests also expect form data, not JSON. That means your request body should contain a text field called text. Don't send a JSON body unless the specific endpoint's documentation tells you to. Different DeepAI endpoints can expect different input formats, so it's worth checking each one before writing a single shared client for all of them.

If you're weighing whether one key across several media types is worth it, it's worth comparing this setup to what a unified AI media API offers. Apiframe, for example, uses one interface for image, video, and music generation, which can cut down on the number of separate integrations you need to maintain.

text
import os
api_key = os.environ["DEEPAI_API_KEY"]
prompt = "A quiet mountain cabin beneath a sky full of stars" response = http_client.post( "TEXT_TO_IMAGE_ENDPOINT", headers={"api-key": api_key}, data={"text": prompt}, timeout=60,
) response.raise_for_status()
result = response.json()
print(result)

Either way, keep the secret key on your own server. Your browser should call your own backend, and that backend adds the DeepAI key before forwarding the request. This also gives you one place to add auth checks, logging, retries, and usage limits.

DeepAI API key authentication and REST request workflow

Key Takeaway: Use the api-key header, send image prompts as form data, and keep every credential on your server, never in client-side code.

Making a Text-to-Image Request and Handling the Response

A DeepAI image request is simple in concept: send a prompt, wait for a response, then read the JSON that comes back. That response usually includes an output_url pointing to the generated image.

That URL works fine for a quick demo, but it shouldn't become the permanent link stored in your database. The image host may delete the file after roughly 24 to 48 hours. If your app only saves that link, older posts can quietly turn into broken images.

Use a short server-side pipeline instead:

  • Accept the prompt from your app.
  • Send the form-data POST request.
  • Read the returned image URL.
  • Download the image bytes at once.
  • Upload those bytes to storage you control.
  • Save your persistent storage URL with the prompt and request ID.

Once you've done that, the image can appear in a gallery, design tool, or content feed without depending on a temporary link from DeepAI. It also helps to add a cache key based on the prompt and settings used. If the same request comes in again, you can serve the saved result instead of generating a new image and spending another credit.

From the user's perspective, generation feels like it's happening in the background, even if your own request technically waits for a response. Test the full flow, including timeouts and clear error messages. If a request takes several seconds, show a loading indicator. Otherwise, people may hit submit again and use up your quota faster than expected.

The prompt itself makes a real difference. "A dog" leaves a lot of room for the model to guess. A prompt that describes the subject, setting, lighting, camera angle, and style gives the model much clearer direction. You can make this easier for your users with built-in style presets, like an "old painting" look or a "3D animal render" option.

For a slightly different approach, the Apiframe API documentation uses a job-based flow: you submit a request, then either poll for the result or receive it through a webhook, and download it once it's ready. That pattern is common for longer video and music jobs, but the same storage advice applies to images too, save the file yourself instead of relying on a temporary link.

text
image_url = result.get("output_url")
if not image_url: raise ValueError("The response did not include an image URL") image_bytes = http_client.get(image_url, timeout=60).content
# Upload image_bytes to storage that your app controls.

Always check the response before showing it to users. Confirm the request succeeded, make sure the URL is actually there, and log any provider error without logging your API key. These small checks save a lot of debugging time later, especially when a prompt fails or the API returns something unexpected.

DeepAI API text to image request response URL and image storage workflow

Pricing, Credits, Pro Benefits, and Broader API Capabilities

DeepAI's pricing is easier to plan around than a lot of usage-based image APIs, since it publishes a free tier along with a stated Pro price of $9.99 per month. That paid plan is described as including higher usage limits, private generations, and an ad-free experience. Always check DeepAI's current pricing page before you finalize a budget, since plan details and limits can change.

The credit model still needs care. A flat monthly price does not mean unlimited capacity for a busy public app. Track requests by user, reject duplicate submissions, and set a daily budget for development. A viral feature can use a fixed allowance much faster than a private prototype.

See the chat page.

That breadth is different from API breadth. Ask for endpoint details before you plan a video or music workflow around it.

Apiframe takes a different approach here. It supports image, video, and music generation through a single interface, though exact pricing and free-tier limits are best confirmed directly with the Apiframe pricing page or the model pricing comparison rather than assumed. This creates a real tradeoff: DeepAI offers clearer, simpler entry pricing for budget-conscious developers, while Apiframe may suit a team that would rather avoid separate integrations for each type of media.

Use Apiframe’s model directory when you need to compare the media scope of a unified API. Before a purchase, ask both vendors about included credits, overage rules, concurrency, failed requests, and commercial use.

Pro tip: Measure your cost per finished image, not cost per API call. Failed requests, retries, storage, and content review can all change the real cost per usable asset.

Use Cases, Limitations, Security, and Production Scaling

The DeepAI API is a good fit for projects that need quick image generation with minimal setup. A design team might use it for early concept sketches. A web app could turn a short user prompt into a profile picture or a visual card. An internal tool might generate a handful of rough creative options before a human designer picks a direction.

It's a weaker fit for workflows that need print-ready output without extra processing. The commonly cited default image size is 512 by 512 pixels, which is fine for previews but not for large banners or high-resolution product photos. Confirm the current size options before promising anything larger in your product.

Speed is another area worth checking carefully. There isn't reliable public data on average response times for DeepAI or for most other providers, including Apiframe. Some examples report waits of several seconds, with longer waits possible depending on load. Treat this as something to plan your interface around, not a guarantee from the provider.

As traffic grows, it helps to treat the whole request path as a queue. Your backend should accept the job, hand back a request ID right away, and let the client check on its status separately. Limit how many jobs a single user can start at once. Add automatic retries with increasing wait times for temporary failures, but cap the number of retries so one bad request doesn't quietly burn through your monthly usage.

A few security habits are worth following no matter how much traffic you have:

  • Keep the API key in server-side secrets only.
  • Set request limits per user.
  • Strip sensitive prompt text out of public-facing logs.
  • Review or scan generated images before showing them publicly.
  • Store permanent files in private storage when access needs to be restricted.
  • Cache successful results, since if ten users request the same preset image, one stored result can serve all of them, but avoid caching private prompts under a shared key. Include the account ID whenever the output needs to stay private.

Cache successful results. If ten users request the same preset artwork, one stored result may serve all ten. But don't cache private prompts under a shared key. Include the account ID when the output should remain private.

If your roadmap includes video or music generation down the line, it's worth evaluating Apiframe as a single integration point rather than adding a separate provider for each media type. Its request, job-polling or webhook, and download pattern gives you a sense of the kind of contract to look for before putting any media API into production. For a broader side-by-side view, the comparison of unified media APIs and the guide to choosing an AI media API both walk through what to weigh beyond price alone.

The decision usually comes down to this: choose DeepAI when a modest image feature and simple, predictable pricing matter most. Test Apiframe when your product needs multiple media types and a single integration, but ask for a written quote and real performance numbers first.

DeepAI API FAQ

How do I get a DeepAI API key?

Create an account and open the developer area on DeepAI's site. Copy the key into a server-side environment variable. Never place it in browser JavaScript, mobile app code, or a public code repository. Your backend should attach the key to each request and expose only your own controlled route to the client.

What header does the DeepAI API use?

DeepAI uses an api-key header for authentication, not the standard bearer token format used in many other REST APIs. Send your key as that header's value, then pass the image prompt as form data. Using the wrong header name can cause an authentication error even when your account and key are both active.

How do I generate an image with Python?

Use any Python HTTP client to send a request to the text-to-image endpoint. Put your key in the api-key header and your prompt in a form field named text. Parse the JSON response, read the returned image URL, and download the file before showing it to users.

How long does a DeepAI image URL last?

A generated image URL may expire after roughly 24 to 48 hours. That means the DeepAI API response isn't meant to be a permanent record. Download the image as soon as the request succeeds, move it into storage you control, and save that permanent URL in your own database.

How much does DeepAI Pro cost?

DeepAI Pro is listed at $9.99 per month and includes higher usage limits, private generations, and an ad-free experience. Your actual project cost still depends on your usage volume, retries, storage, and traffic, so confirm current terms on your account page before budgeting.

Is DeepAI good for production apps?

DeepAI can work well in production once you add the pieces it doesn't handle for you. Proxy the API key through your own server, save images to your own storage instead of relying on temporary links, show a loading state during generation, and set limits on how many requests a single user can make. Test image size, speed, quota behavior, and error handling before launch. If your product needs more than just images, it's worth comparing DeepAI with Apiframe's unified API approach.

For a single image feature, start with one server-side request and a simple storage step for the results. If your product is likely to grow into video or music generation too, it's worth evaluating Apiframe early, asking for clear pricing and speed numbers, and running a small load test before committing.

The Apiframe dispatch

New models, engineering write-ups, and build guides in your inbox. No noise, unsubscribe anytime.