AI companion and character apps live or die on their media: profile images, in-chat pictures, and short clips that feel personal. The hard part is that this content is usually adult or suggestive — exactly what filtered APIs reject. This guide lays out a backend architecture using an uncensored generation API (Api18.dev) for the media layer.
Where the generation API fits#
Generation belongs on your server, never the client. The flow per user action looks like:
- The app sends a request to your backend (“send me a new selfie”).
- Your backend builds a prompt and calls Api18.dev with your Bearer key.
- You receive a media URL, store it in your own storage, and return your URL to the app.
API18_KEY in the mobile/web client. Keep it server-side and expose only your own authenticated endpoints.The core call
From your backend, generation is a single request. Image-edit and image-to-video models let you keep a character consistent across turns.
const res = await fetch("https://api18.dev/v1/generate?wait=true", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.API18_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "<image-model-id>",
prompt: "your prompt here",
}),
});
const job = await res.json();
console.log(job.data[0].url); // the generated imageKeeping a character consistent#
- Generate a canonical reference image once, store it, and reuse it as the input to image-to-video or image-edit calls.
- Fix the
seedfor stable variations on the same prompt. - Keep a per-character prompt template so style stays consistent across sessions.
Cost control#
- Each job reports
cost_usd— log it per user to meter and bill your own customers. - Cache and reuse media instead of regenerating identical requests.
- Failed jobs are refunded automatically, so you don’t eat the cost of errors.
- Start on the $10 welcome credit to prototype before spending.
Safety & policy at the product layer#
Uncensored means the filter is yours to define. For a companion app you should:
- Age-gate signup and enforce it server-side.
- Moderate any user-supplied prompt text before it reaches the API.
- Prohibit and block illegal content in your own terms and pipeline.
Payments & scaling#
Fund the account with USDT on Solana or Tron and top up as usage grows — there’s no subscription tier to outgrow. When you’re ready to wire it up fast, the LLM-ready reference lets ChatGPT, Claude or Cursor scaffold the backend calls for you, and the 5-minute quickstart covers the minimal integration.