DocsQuickstart with Synexa AI

Quickstart with Synexa AI

In this guide, we’ll walk you through using Synexa AI in your applications.

Authentication

Before proceeding, you’ll need to create an API key. This key will be used to authenticate your requests to the Synexa AI API.

Python Installation & Setup

Install the Python client:

pip install synexa

Set your API key:

import synexa
 
# Option 1: Environment variable
# export SYNEXA_API_KEY=your-api-key
 
# Option 2: Direct initialization
client = synexa.Synexa(api_key="your-api-key")

Node.js Installation & Setup

Install the Node.js client:

npm install synexa

Initialize the client:

import Synexa from 'synexa';
 
const synexa = new Synexa.default({
  auth: process.env.SYNEXA_API_TOKEN // Your Synexa API token
});

Making Your First API Call

Here’s a simple example using our image generation model:

Python

import synexa
 
# Run the model
output = synexa.run(
    "black-forest-labs/flux-schnell",
    input={"prompt": "An astronaut riding a rainbow unicorn, cinematic, dramatic"}
)
 
# Save the generated image
for i, img in enumerate(output):
    with open(f'output_{i}.webp', 'wb') as f:
        f.write(img.read())

Node.js

// Run the model and get the output
const [output] = await synexa.run("black-forest-labs/flux-schnell", {
  input: {
    prompt: "An astronaut riding a rainbow unicorn, cinematic, dramatic"
  }
});
 
// Handle the output
if (output instanceof FileOutput) {
  console.log(output.url()); // Get the URL string
  const blob = await output.blob(); // Get the file data
}

Available Models

We offer a variety of popular models that are ready to use:

  • Image Generation
  • Video Generation
  • Speech-to-Text
  • Text Generation
  • And more…

All models are available as ready-to-use APIs that you can easily integrate into your applications.

Next Steps

Check out our guides section to learn more about specific use cases:

When you find a model you want to use, you can find its documentation and example code in the “API” tab of each model’s page.