EN ▾
Get API key

Uncensored AIHow to Use an AI Image API

How to Use a Text API with an AI Image API

An AI image API connects your workflow to generative models, but the text layer—prompt engineering, script generation, and metadata extraction—remains a distinct engineering challenge. This guide details how to integrate text generation into your media pipeline using standard protocols like OpenAI-compatible endpoints.

How to Use a Text API with an AI Image API

Updated

01Uncensored AI

Key points

  1. Text APIs handle prompt construction, script writing, and metadata extraction independently of image generation models.

  2. OpenAI-compatible endpoints allow direct integration using standard SDKs without custom protocol development.

  3. Streaming support enables real-time token delivery, essential for interactive prompt refinement workflows.

  4. Token pricing is usage-based, with specific limits on context windows and request rates.

Why Text APIs Matter for Image Pipelines

Image generation models produce pixels, but they require precise textual instructions to function effectively. A dedicated text API handles the semantic layer of your pipeline, converting high-level concepts into structured prompts, generating captions, or extracting metadata from existing media. This separation of concerns allows you to optimize text generation independently from compute-heavy image rendering.

Unlike multimodal models that combine vision and language, a text-only API focuses on language understanding and generation. This specialization often results in lower latency and more predictable output formats, which are critical for automated workflows. Developers use these APIs to script narratives, generate diverse prompt variations, or post-process raw text before it reaches an image generator.

  • Prompt engineering: Automatically refine raw ideas into detailed descriptions.
  • Metadata extraction: Pull structured data from unstructured text inputs.
  • Script generation: Create cohesive narratives for video or comic pipelines.

Choosing an Uncensored Model

Content filtering in text models can inadvertently reject valid artistic or narrative content. An uncensored model reduces refusals for lawful adult themes, niche genres, or controversial topics, ensuring your pipeline processes input without arbitrary blocking. This is particularly valuable for creative workflows where subjective interpretation varies.

When selecting a model, verify that it is an independent large language model rather than a proxy for major vendors. Our API serves a specific open-weight model tuned for minimal refusal, distinct from GPT, Claude, or Gemini. This independence ensures that content policies are consistent and predictable, rather than dependent on the shifting guidelines of a third-party provider.

The model supports a 100,000-token context window, allowing you to feed extensive style guides or character sheets. However, note that this window covers both input and output combined. There is no separate output cap, and if you do not set the max_tokens parameter, the response can run to the end of the window.

Step 1: Selecting the Right API

Choose an API that adheres to the OpenAI chat-completions standard. This compatibility allows you to use existing SDKs and tools, reducing integration time. Look for a service that provides a stable base URL and clear endpoint definitions.

Our API operates at https://api.uncensoredaiimage.com/v1. It exposes only the essential endpoints: POST /v1/chat/completions for generation and GET /v1/models for model discovery. There are no embeddings, audio, or video generation endpoints, keeping the service focused on text tasks.

FeatureDetail
Base URLhttps://api.uncensoredaiimage.com/v1
Model IDuncensored
Context Window100,000 tokens (input + output)
Default OutputUp to the end of the window

Step 2: Integration with OpenAI SDKs

Integrating the API requires configuring your SDK client with the correct base URL and API key. The process is straightforward for developers familiar with standard LLM clients.

Set the base URL to our endpoint and pass your API key in the authorization header. The model ID is fixed at uncensored. This configuration ensures that your requests are routed correctly without needing custom protocol handlers.

The API supports standard parameters such as temperature, top_p, stop, and seed. You can also enable JSON mode by setting response_format to {"type": "json_object"} for structured output, which is useful for generating metadata or configuration files.

Function calling is supported via the tools and tool_choice parameters, allowing you to integrate custom logic into your text generation workflow.

Step 3: Handling Streaming Data

Streaming allows you to receive tokens as they are generated, reducing perceived latency for interactive applications. The API supports Server-Sent Events (SSE) for streaming responses.

When streaming, the final chunk contains the total token usage statistics. This allows you to track costs and context usage in real-time without waiting for the entire response to complete.

Implement a stream handler in your client to process chunks as they arrive. This is particularly useful for long-form script generation or detailed prompt expansion, where users may want to see progress incrementally.

Step 4: Advanced Prompt Engineering

With a 100,000-token context window, you can provide extensive context to the model. This includes detailed style guides, character descriptions, or previous conversation history.

However, the context window is shared between input and output. If you provide a large prompt, the maximum output length decreases accordingly. For example, if you use 48,000 tokens for input, you can generate up to 52,000 tokens in the output.

Use the max_tokens parameter to control output length. If omitted, the response can run to the end of the window. Set a lower value for shorter outputs such as detailed image prompts.

Step 5: Error Handling and Limits

The API enforces specific limits to ensure stability. Each API key is limited to 300 requests per minute and 8 concurrent requests. The maximum request body size is 8 MB.

If you exceed these limits, you will receive a rate limit error. Ensure your client implements exponential backoff for retries.

Errors such as network timeouts or server errors do not consume credit. Only successful token generation is charged. This means that transient errors are free, reducing risk during high-volume operations.

Step 6: Cost Optimization

Pricing is based on actual token usage. Input tokens cost $0.15 per million, and output tokens cost $0.50 per million. There are no monthly fees or subscriptions.

Credit is prepaid and never expires. You can top up using cryptocurrency (USDT on TRC20 or USDC on Base) in amounts between $20 and $500. A 5% bonus is added for deposits of $50 or more, and a 10% bonus for deposits of $100 or more.

New accounts receive $0.50 in trial credit, valid for 7 days, with no credit card required. This allows you to test the API before committing to a paid plan. Claim this credit with one click on your API key page.

02Uncensored AI

Questions and answers

What is the context window size?

The context window is 100,000 tokens, which includes both input and output. There is no separate output cap, and if the max_tokens parameter is not set, the response can run to the end of the window.

What are the rate limits?

Each API key is limited to 300 requests per minute and 8 concurrent requests. The maximum request body size is 8 MB.

How do I pay for the API?

Payment is via cryptocurrency only (USDT on TRC20 or USDC on Base). Deposits range from $20 to $500, with bonuses for larger amounts. No credit cards or bank transfers are accepted.

Is there a free trial?

Yes, new accounts receive $0.50 in trial credit valid for 7 days. Claim this credit with one click on your API key page. No credit card is required to sign up.

Uncensored AIuncensoredaiimage.com

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key