Create an App
This page covers how to create an app using the POST /app
endpoint. An app encapsulates configuration details—like GPU IDs, model URLs, and workflow templates—that enable it to run AI tasks.
Required Headers
x-api-key
: A valid API key for the authenticated user.x-team-id
: The ID of the associated team (can be null if no team is involved).Content-Type
:application/json
Request Body
name
(string, required): A name for your app.description
(string, optional): Description of your app.configuration
(object, required): Configuration details (GPU Tier, workers, etc.).workflow
(object, required): Workflow definition, including the model URL.
Once you have these headers and the required fields, you can perform a request to create your first app.
Example Requests
- Bash
- Python
curl --location 'https://api.rungen.ai/app' \
--header 'x-api-key: <YOUR-API-KEY>' \
--header 'x-team-id: <YOUR-TEAM-ID>' \
--header 'Content-Type: application/json' \
--data '{
"name": "My first app",
"description": "This is my first app with Flux",
"configuration": {
"gpu_tier": "STANDARD"
},
"workflow":{
"model_url": "https://huggingface.co/black-forest-labs/FLUX.1-schnell",
"tools":{
}
}
}'
import requests
import json
url = "https://api.rungen.ai/app"
payload = json.dumps({
"name": "My first app",
"description": "This is my first app with Flux",
"configuration": {
"gpu_tier": "STANDARD"
},
"workflow": {
"model_url": "https://huggingface.co/black-forest-labs/FLUX.1-schnell",
"tools": {}
}
})
headers = {
'x-api-key': '<YOUR-API-KEY>',
'x-team-id': '<YOUR-TEAM-ID>',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
You should receive a response like this
{
"data": {
"configuration": {
"active_workers": 0,
"gpu_tier": "STANDARD"
},
"created_at": "2024-12-15T13:42:54",
"created_by": "5a57d473-c8b9-4507-a325-a1b0b9fe2c5e",
"description": "This is my first app with Flux",
"id": "1836a0eb-d84b-4880-8d13-cfa4f3bdaeb5",
"name": "My first app",
"owner_team_id": "<YOUR-TEAM-ID>",
"owner_user_id": null,
"status": "STOPPED",
"updated_at": "2024-12-15T13:42:54",
"workflow": {
"model_url": "https://huggingface.co/black-forest-labs/FLUX.1-schnell",
"tools": {}
}
}
}
configuration
: Shows app configuration details. Here, gpu_tier is BASIC and active_workers defaults to 0 if not specified.status
: The app is currently STOPPED. You must start or run the app before it can process jobs.id
: A unique app identifier (e.g., 1836a0eb-d84b-4880-8d13-cfa4f3bdaeb5). Make sure to save this for future requests (like running jobs or updating the app).