Netwrck logo Netwrck
Netwrck > Tools > API Documentation > Flux Kontext

Flux Kontext API

The Flux Kontext API provides advanced AI image generation with superior context understanding. Generate high-quality images that better understand spatial relationships, object placement, and scene composition from your text descriptions.

Quick Start

Generate your first context-aware AI image in 30 seconds

Get Your API Key

Sign in to your account to get your API key and see it automatically filled in all code examples.

Don't have an account? Sign up for free

import requests

# Generate your first context-aware AI image
response = requests.post(
    "https://netwrck.com/api/flux-kontext",
    json={
        "api_key": "YOUR_API_KEY",
        "prompt": "A red apple on a wooden table next to a blue vase, natural lighting",
        "size": "1024x1024"
    }
)

result = response.json()
print(f"Image generated: {result['image_url']}")
print(f"Cost: {result['credits_charged']} credits")
// Generate your first context-aware AI image
fetch('https://netwrck.com/api/flux-kontext', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    api_key: 'YOUR_API_KEY',
    prompt: 'A red apple on a wooden table next to a blue vase, natural lighting',
    size: '1024x1024'
  })
})
.then(res => res.json())
.then(result => {
  console.log('Image generated:', result.image_url);
  console.log('Cost:', result.credits_charged, 'credits');
})
.catch(error => console.error('Error:', error));
# Generate your first context-aware AI image
curl -X POST https://netwrck.com/api/flux-kontext \
  -H 'Content-Type: application/json' \
  -d '{
    "api_key": "YOUR_API_KEY",
    "prompt": "A red apple on a wooden table next to a blue vase, natural lighting",
    "size": "1024x1024"
  }'

Authentication

All API requests require your API key. Sign in to get your API key and see it automatically filled in all code examples.

{
  "api_key": "YOUR_API_KEY"
}

Pricing & Credits

Cost Per Image

$0.04 USD

4 credits per successful generation

Billing Policy

Success: Charged 4 credits

Failed: No charge

Only pay for successful generations

API Reference

POST /api/flux-kontext

Generate context-aware AI images with superior spatial understanding

📝 Request Format

Send a POST request with a JSON body containing these parameters:

ParameterTypeRequiredDescription
api_key string Required Your API key for authentication.
prompt string Required Text description of the image. Flux Kontext excels at understanding spatial relationships and object placement. Max 1000 characters.
image_url string Optional Reference image URL to guide generation. Supports JPG, PNG, WEBP formats. Max 10MB.
size string Optional Image size in widthxheight format. Default: "1024x1024". Supported sizes:
  • 1024x1024 (Square)
  • 1152x768 (Landscape 3:2)
  • 768x1152 (Portrait 2:3)
  • 1152x864 (Landscape 4:3)
  • 864x1152 (Portrait 3:4)
  • 1360x768 (Widescreen 16:9)
  • 768x1360 (Tall 9:16)

Response Examples

Success Response (200 OK)

When your image is successfully generated, you'll receive:

{
  "image_url": "https://netwrckstatic.netwrck.com/static/uploads/ai/flux-kontext-image.webp",
  "prompt_used": "A red apple on a wooden table next to a blue vase, natural lighting",
  "size_used": "1024x1024",
  "credits_charged": 4
}

Error Responses

If something goes wrong, you'll receive one of these error responses:

401 Unauthorized

{
  "error": "Invalid API key",
  "status": 401
}

Check your API key is correct

402 Payment Required

{
  "error": "Insufficient credits",
  "status": 402
}

Add more credits to your account

400 Bad Request

{
  "error": "Prompt is required",
  "status": 400
}

Check your request parameters

500 Server Error

{
  "error": "Internal server error",
  "status": 500
}

Try again in a moment

Pro Tips for Better Results

Context-Aware Prompting

  • Specify spatial relationships: "next to", "behind", "in front of"
  • Use directional terms: "on the left", "in the center", "at the bottom"
  • Describe object interactions: "resting on", "leaning against"
  • Include environment details: "on a wooden table", "against a brick wall"

Reference Images

  • Use reference images for composition guidance
  • Images help define layout and positioning
  • Combine with detailed prompts for best results
  • JPG, PNG, WEBP formats supported (max 10MB)

Example Context-Rich Prompts

"A vintage camera positioned on the left side of a mahogany desk, with an open notebook on the right side and a coffee mug in the center background"

"Three potted plants arranged in a row on a white windowsill, the tallest one on the left casting shadows on the middle plant, morning sunlight streaming through"

"A black cat sitting upright on a red velvet cushion placed on the corner of a Victorian armchair, with a bookshelf visible in the soft-focus background"

Welcome Back to Netwrck



Don't have an account? Sign up here

Join Netwrck - AI Art & Chat

Create AI art, search the web, generate videos and edit photos. Get started with your free account today!



Already have an account? Login here

Netwrck Unlimited

Voice Chat - Character Creation - Art Generation

30 day Money Back Guarantee.


Art Generator Settings


Resolution
Aesthetic Elf Styles
Anime Anime
Photographic Photographic
Digital Art Digital Art
Comic Book Comic Book
Fantasy Art Fantasy Art
Neon Punk Neon Punk
Knight Knight
Ethereal Ethereal
Low Poly Low Poly
Stunning Stunning
Line Art Line Art
Cinematic Cinematic
Wanderer Wanderer
Beggar Beggar
Seductive Seductive
Warrior Warrior
Steampunk Steampunk
Japanese Japanese
Western Western
Handsome Handsome
Pop art Pop art
Abstract Abstract
Impressionist Impressionist
Fauvist Fauvist
Beauty grace Beauty grace
Evil Evil
God God
Demon Demon
Masculine Masculine
Feminine Feminine
Majestic Majestic
Mage Mage
Princess Princess
King King
Sweet Sweet
Fantasy Fantasy

AI Generated Images


Community Images


New AI

person
This is what your AI will say when someone first chats with them
Help others understand what your AI character is about

AI Settings

Audio Settings
1.5x

Art Generation

When enabled, AI can automatically generate art based on conversations

Prepended to art prompts when Make Art runs.

High Resolution

Creating Video

No AI characters found.

Help Everyone Know You

person

Share Image

Consider our affiliate program to earn!

Copy

Reddit

X

Facebook

LinkedIn

NETW Coin is live!

AI should be owned by everyone.
So we are building a new AI economy together.
Thank you for being on this journey with us!
Read More

Netwrck Android App

Our Android App Is Available Now - Please Check it out!

AI Characters in room

Search Characters