EN ▾
Get API key

Flux API Key: What It Is and Where a Text API Fits

A Flux API key is a credential for an image generation service, and this site does not sell one. What it sells is a different key, for a hosted text LLM API that can write and expand the prompts you feed to an image model.

Updated

Two separate keys, one linked to an image frame and one to chat bubbles, two separate APIs

Key points

  • A key for a Flux image service and a key for a text LLM API are two separate things, issued by two separate providers.
  • This site is text only: no image, audio or video generation, and it is not run by any image-model vendor.
  • A text key is useful next to an image key because prompt writing is a text task, billed per token.
  • You change one base URL and one key in any OpenAI client to start, and a trial credit covers first tests.

What people usually mean by a Flux key

Flux is the name of a family of text-to-image models. When someone types flux api key into a search box, they almost always want a credential that lets their code send a prompt to a service hosting one of those image models and get a picture back. That credential comes from whichever company runs the image endpoint you picked. It is tied to their account, their billing and their terms.

You will see the phrase used in a few slightly different ways, and it helps to sort them out before you paste a key anywhere:

  • A key from an image host that serves Flux models, used in a request that returns an image.
  • A key for a local or self-hosted setup, where you create the token yourself and nothing leaves your machine.
  • A key for some other tool in your pipeline, such as a text model that writes the prompts, which only gets called Flux because the project is named that way.

Only the first two produce pictures. The third is where this site sits. We run a hosted, OpenAI-compatible LLM API, and the key you get here works against that API and nothing else.

Why an image key will not call a chat model

The two kinds of key look similar, since both are long strings you send in an Authorization header, but they open different doors. An image provider's key is checked by the image provider. If you send it to a chat endpoint, you get an authentication error, and the reverse is just as true: a key from this site returns an error if you send it to an image host.

The request bodies differ as well. An image call usually carries a prompt, dimensions, a seed and a count of pictures. A chat call carries a list of messages with roles, and returns text. There is no shared schema, so there is nothing to translate between them. If you have a script that works against an image host, keep that script and its key exactly as they are. Add the text call as a separate step in front of it.

What this service does not do

To keep expectations clear: the API here is text only. It does not generate images, audio or video, it does not create embeddings, and it does not offer fine-tuning. It is not the official API of any model vendor and it is not a router across vendors. It serves one open-weight model, tuned to answer without content refusals for lawful adult use, and run by an independent provider. The model ID you pass is uncensored.

Where a text API fits next to an image key

Prompt writing is the obvious meeting point. Image models respond well to specific, structured descriptions: subject, setting, lens, lighting, colour, mood. Most people write those by hand, then rewrite them after a bad result. A text model can do the first draft, expand a three-word idea into a full description, or produce twenty variations on a theme while you go and get coffee.

A few jobs that fit well:

  • Expansion. Turn a short idea into a detailed prompt in a style you set once in the system message.
  • Variation. Ask for ten different takes on one subject, returned as a JSON list your script can loop over.
  • Cleanup. Rewrite a messy prompt written by a customer into something an image model handles better.
  • Scripts and captions. Write the narration, shot list or caption that goes next to the picture.

Because the model here does not refuse by default, it suits fiction, character design and mature themes that other hosted models often decline, as long as the use is lawful and involves adults. One hard limit applies everywhere: no sexual content involving minors. Requests like that are not something we support in any form.

A first call in under a minute

Any OpenAI SDK or HTTP client works once you swap the base URL and key. The endpoint for chat is POST /v1/chat/completions, and GET /v1/models lists the model. Here is the same request in curl and in Python.

curl https://api.fluxapikey.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [
      {"role": "system", "content": "You write detailed image prompts. Reply with the prompt only."},
      {"role": "user", "content": "a lighthouse in a storm, painterly"}
    ]
  }'
from openai import OpenAI

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

reply = client.chat.completions.create(
    model="uncensored",
    messages=[
        {"role": "system", "content": "You write detailed image prompts. Reply with the prompt only."},
        {"role": "user", "content": "a lighthouse in a storm, painterly"},
    ],
)
print(reply.choices[0].message.content)

Whatever string comes back is what you hand to your image service, using that service's own key. The two never touch each other. For the full list of parameters, including streaming, tool calling and JSON mode, see the API documentation.

Do you need both keys?

It depends on what you are building. The table below is a quick way to decide.

Your goalImage keyText key
Generate pictures from prompts you write yourselfYesNo
Generate pictures from prompts a model writes or expandsYesYes
Write stories, dialogue or scripts onlyNoYes
Build a chat or roleplay app for adultsNoYes
Batch-produce hundreds of prompt variationsOptionalYes

If you only ever type your own prompts and are happy with them, a text key adds little. If you find yourself rewriting prompts all afternoon, or you need volume, it earns its cost quickly. We also have a short walk-through on using a text LLM in video workflows, which follows the same idea of a text step in front of a media step.

Mistakes that come from mixing up keys

Most problems in a two-service setup are small and easy to spot once you know what to look for.

  • Wrong base URL. If your client still points at the old host, the new key is rejected. Check that the base URL ends in /v1 and matches the one in the example above.
  • Wrong model name. The only model ID here is uncensored. Passing the name of an image model returns an error, because there is no such model on this API.
  • Keys in one environment variable. Give each service its own variable, for example TEXT_API_KEY and IMAGE_API_KEY. Sharing one name is how a key ends up sent to the wrong host.
  • Expecting pictures in the reply. The response is plain text in choices[0].message.content. If you need an image, that text has to go to your image service as a second call.
  • Ignoring 429. A burst above 8 concurrent requests returns a 429 with the error code concurrency, and above 300 requests per minute with rate_limited. Back off briefly and retry. A streamed request holds its slot until the stream finishes, so close streams you no longer read.

The trial key has lower ceilings: 2 concurrent requests and 60 per minute. That is plenty for testing a prompt-writing step by hand, but a large batch should wait for a topped-up key.

What prompt writing costs

Billing is per token and prepaid: $0.15 per 1M input tokens and $0.50 per 1M output tokens, with no subscription. Prompt jobs are small, so the numbers are small. Take a request with a 600-token system message plus idea (input) and a 250-token expanded prompt (output). Input costs 600 / 1,000,000 x $0.15 = $0.00009. Output costs 250 / 1,000,000 x $0.50 = $0.000125. One request is $0.000215.

A batch of 1,000 such requests therefore costs about $0.215. The $0.50 trial credit, which you can claim with one click on the key page after sign-up, covers roughly 2,300 of them (0.50 / 0.000215). It needs no card and lasts 7 days. Failed or refused requests are not charged, and credit you add later never expires. Details are on the pricing page.

Getting your text key

Sign up with Google, or with an email and password, then open the API key page. Claim the trial credit there if you want to test first. Paid top-ups run from $20 to $500 in any whole amount, with +5% bonus from $50, +10% from $100 and +15% from $200. You can pay with crypto (USDT on TRC20, USDC on Base).

Keep the key out of client-side code and out of public repositories. Prompts you send are not used for training, but a leaked key spends your credit. The full key allows 8 concurrent requests and 300 requests per minute, so a prompt batch can run in parallel without extra work.

Questions and answers

Can I use this key to generate images with Flux?

No. The key works only against this site's text API. Image generation needs a key from a provider that hosts an image model.

Is this the official Flux API?

No. This is an independent, hosted, OpenAI-compatible text API with one model, named uncensored. It is not run by any image-model vendor and does not resell their services.

Can the text model write prompts for my image tool?

Yes. Ask for a prompt in the system message, take the reply text and paste or send it to your image service. The two services stay independent.

Do I need a card to try it?

No. New users can claim $0.50 of trial credit with one click on the key page, valid for 7 days, with no card needed.

Your key is one form away

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

Get API key