Uncensored text API for your pipeline

Nano Banana API: Prompts and scripts over one endpoint

Get started with the Nano Banana API in minutes. This guide covers authentication, basic requests, streaming, and tool calling using the standard OpenAI-compatible format.

Authentication and Base URL

Access the nano banana api by pointing your client to https://api.nanobananaapis.com/v1. You need a valid API key in the Authorization header. Sign up on the Get API key page with just an email and password to receive your key instantly. The key is shown immediately after signup. If you lose it, regenerate a new one from your dashboard; the old key stops working right away.

Use Bearer YOUR_API_KEY for every request. The model ID is always uncensored. This endpoint handles text in and text out. It does not generate images, audio, or video. For multimodal pipelines, use this API for prompt writing, script generation, and post-processing.

First Request

Send a standard chat completion request. The API supports the OpenAI format. Replace YOUR_API_KEY with your actual key. This example sends a simple message to the uncensored model.

curl https://api.nanobananaapis.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
  }'

The response contains the generated text. You can inspect the usage token counts in the response body. The context window is 64,000 tokens total for prompt and completion. Keep your payloads under 8 MB.

Python SDK Example

Use the official OpenAI Python SDK. Set the base URL to the nanobananaapis endpoint. Pass your API key as the api_key. The client will automatically format requests correctly. This method is ideal for backend scripts that need to process text before sending it to an image or video generation service.

from openai import OpenAI

client = OpenAI(base_url="https://api.nanobananaapis.com/v1", api_key="YOUR_KEY")

resp = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Summarise this thread without softening it."}],
)
print(resp.choices[0].message.content)

The SDK handles streaming and parsing for you. You can iterate over chunks if you enable streaming mode. This approach keeps your code clean and compatible with other OpenAI services if you switch providers later.

Node SDK Example

The Node.js SDK works similarly. Initialize the client with your base URL and key. Call the chat.completions.create method. This is useful for serverless functions or web servers that need to generate scripts dynamically.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.nanobananaapis.com/v1", apiKey: process.env.API_KEY });

const resp = await client.chat.completions.create({
  model: "uncensored",
  messages: [{ role: "user", content: "Draft a villain monologue for my game." }],
});
console.log(resp.choices[0].message.content);

Ensure you handle errors properly. Common errors include authentication failures (401) if the key is invalid or expired, and rate limits (429) if you exceed 300 requests per minute. The API key is tied to your account, so protect it in your environment variables.

Streaming Responses

Enable streaming by setting stream: true in your request. The API returns a Server-Sent Events (SSE) stream. Each chunk contains part of the generated text. This is essential for real-time applications or when generating long scripts.

stream = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Tell the story in second person."}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Parse the SSE events on your client side. The stream ends when the model finishes generating or hits the context limit. Streaming reduces perceived latency for users. It does not change the pricing; you still pay per token.

Limits, Errors, and Models

Check available models via GET /v1/models. The only model is uncensored. Rate limit is 300 requests per minute per key. Request body must be under 8 MB. Pricing is $0.25 per 1M input tokens and $1.00 per 1M output tokens. Credit never expires. If you run out, top up from $10. Errors: 401 for bad keys, 402 for insufficient credit, 429 for rate limits. No SLA or uptime guarantee is provided. The model blocks sexual content involving minors. It does not refuse other lawful adult or controversial topics.

Under the hood: specs

Use this table to decide whether the API fits your project before you buy credit.

FeatureSupport
API formatOpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key
AuthenticationAuthorization: Bearer YOUR_KEY
Modeluncensored
EndpointsPOST /v1/chat/completions · GET /v1/models
Base URLhttps://api.nanobananaapis.com/v1
JSON moderesponse_format: {"type": "json_object"}
Max output16,000 tokens max; 2,048 if max_tokens is not set
Sampling parameterstemperature, top_p, stop, seed and the two penalties are passed through
SSE streamingSupported (stream: true), usage included at the end
Tools / tool callsYes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool
Max context64,000 tokens, input and output combined
Max body8 MB request body
Response headersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Parallel requests8 requests at the same time per key
Rate limit300/min per key
Top-upcrypto: USDT on TRON or USDC on Base, $10–$500, any whole sum
Volume bonus+5% on $50+, +10% on $100+
Billingpay as you go from prepaid credit; nothing is charged for failed or refused requests
Trial credit$0.50 for 7 days, no card
Priceinput $0.25 / 1M tokens, output $1.00 / 1M tokens
Subscriptionpaid credit never expires, no subscription
Key managementone active key per account; a new key replaces the old one
Sign-inGoogle or e-mail and password
Contentuncensored for adults; the only hard rule: no sexual content involving minors

When a request fails

The type field is stable, the message is for humans. Errors cost nothing.

HTTPTypeWhat to do
400bad_requestinvalid JSON, empty messages, bad parameter, or prompt + max_tokens over the window — fix and resend
401missing_key · invalid_key · key_revokedcheck the Authorization header or use your current key
402no_creditbalance is empty — top up, requests resume at once
403content_blockedsexual content involving minors — refused, not billed
404not_foundonly /v1/chat/completions and /v1/models exist
413request_too_largerequest body larger than 8 MB
429rate_limited · concurrencyslow down: rate or parallel limit reached
503upstream_busymodel busy — retry in a few seconds

Questions and answers

Is this the official OpenAI API?

No. It is an OpenAI-compatible API running our own open-weight model. It uses the same request format and SDKs but is a separate service. Check the official OpenAI documentation for their specific features and limits.

Do you store my prompts for training?

No. We do not use your prompts to train the model. Your data is used only to generate the response for that request. Privacy is a core feature of the uncensored workflow.

Can I use this for image generation prompts?

Yes. This API is ideal for generating text prompts for image, audio, or video models. It handles the text part of your pipeline. We do not generate the media files ourselves.

Your key is one form away

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

Get API key