POST
/
images
/
generations
from together import Together
import os

client = Together(
api_key=os.environ.get("TOGETHER_API_KEY"),
)

response = client.images.generate(
model="black-forest-labs/FLUX.1-schnell",
steps=4,
prompt="A cartoon of an astronaut riding a horse on the moon",
)

print(response.data[0].url)
{
  "id": "<string>",
  "model": "<string>",
  "object": "list",
  "data": [
    {
      "index": 123,
      "b64_json": "<string>",
      "type": "b64_json"
    }
  ]
}

Authorizations

Authorization
string
header
default:default
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Response

200 - application/json

Image generated successfully

The response is of type object.