API

LLMs

Endpoint

https://app.zohal.cloud/api/v1/llms

If you're looking for models, see LLMs part of this documentations. We have a handful of LLMs you can use.

Parameters

  • messages : A list of JSON objects defining the role of your LLM and also your users prompts.
  • max_tokens: Maximum amount of tokens you can put in your prompts (consider we usually reserved around 30-40 tokens for our system prompts)
  • temperature : This parameter determines the creativity of the model.

cURL

curl --location --request POST 'https://app.zohal.cloud/api/v1/llms' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model" : "jabir-400b",
    "messages": [
        {
        "role": "user", 
        "content": "Hi, who are you?"
        }
    ],
    "max_tokens": 1024,
    "temperature": 0.9
}'

Python

import requests
import json

url = "https://app.zohal.cloud/api/v1/llms"

payload = json.dumps({
  "model": "jabir-400b",
  "messages": [
    {
      "role": "user",
      "content": "Hi, who are you?"
    }
  ],
  "max_tokens": 1024,
  "temperature": 0.9
})
headers = {
  'Authorization': 'Bearer YOUR_API_KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Sample output

{"model":"jabir-400b","result":{"role":"assistant","content":"I'm Jabir, an AI assistant created by Muhammadreza Haghiri, an Iranian entrepreneur and engineer who founded the Mann-E startup. I have been developed to help users like you by answering questions and providing information on a wide range of topics. How can I assist you today?"}}

Image models

Mann-E Dreams

Endpoint

https://app.zohal.cloud/api/v1/images/mann-e/fast

Parameters

  • prompt : What you want to make
  • size : The pictures ratio. Available options are 1:1 and 9:16 and 16:9.
  • style : The style of your desired outputs. Available options are nostyle, comic, anime, logo, vector, flat and impressionist.

cURL

curl --location --request POST 'https://app.zohal.cloud/api/v1/images/mann-e/dreams' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "prompt" : "A little rabbit",
    "style" : "nostyle",
    "size" : "1:1"
}'

Python

import requests
import json

url = "https://app.zohal.cloud/api/v1/images/mann-e/dreams"

payload = json.dumps({
  "prompt": "A little rabbit",
  "style": "nostyle",
  "size": "1:1"
})
headers = {
  'Authorization': 'Bearer YOUR_API_KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Sample Output

{
    "negative_prompt": "",
    "prompt": "A little rabbit",
    "revised_prompt": false,
    "style": "nostyle",
    "url": "https://mann-e-images.storage.c2.liara.space/6a777c2e-be06-462e-a46f-5800358b8ff2.png"
}

Mann-E Fast

Endpoint

https://app.zohal.cloud/api/v1/images/mann-e/fast

Parameters

  • prompt : What you want to make
  • size : The pictures ratio. Available options are 1:1 and 9:16 and 16:9.
  • style : The style of your desired outputs. Available options are nostyle, comic, anime, logo, vector, flat and impressionist.

cURL

curl --location --request POST 'https://app.zohal.cloud/api/v1/images/mann-e/fast' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "prompt" : "a pineapple",
    "size" : "9:16",
    "style" : "anime"
}'

Python

import requests
import json

url = "https://app.zohal.cloud/api/v1/images/mann-e/fast"

payload = json.dumps({
  "prompt": "a pineapple",
  "size": "9:16",
  "style": "anime"
})
headers = {
  'Authorization': 'Bearer zc-9184nxcq0knnjdv566y4rz7qfrx8e72r8koeh1kng4mg0gps',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Sample Output

{"url":"https://mann-e-images.storage.c2.liara.space/0332249e-f0cb-43d4-a8a6-934520e7b3c9.png"}

Mann-E Quality/Anime

Description

This is a two part API. With one, you just create a task and with the other one, you're reviewing your task. If your task is finished, your images are ready.

Endpoints

  • For creating the task: https://app.zohal.cloud/api/v1/images/mann-e/quality
  • For reviewing the task: https://app.zohal.cloud/api/v1/images/mann-e/quality/review

Parameters

  • model : has to options, one is quality and the other is anime
  • prompt : What you want to make
  • size : The pictures ratio. Available options are 1:1 and 9:16 and 16:9, and every aspect raito you use on Midjourney can be applied here.
  • style : The style of your desired outputs. Available options are nostyle, comic, anime, logo, vector, flat and impressionist.

cURL

Task creation:

curl --location --request POST 'https://app.zohal.cloud/api/v1/images/mann-e/quality' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model" : "quality",
    "size" : "3:2",
    "prompt" : "a pineapple, watercolorpainting",
    "style" : "nostyle"
}'

Task Review:

curl --location --request POST 'https://app.zohal.cloud/api/v1/images/mann-e/quality/review' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "task_id" : "0df67a0a-b183-4e48-8977-ae880792afdb"
}'

Python

Task creation:

import requests
import json

url = "https://app.zohal.cloud/api/v1/images/mann-e/quality"

payload = json.dumps({
  "model": "quality",
  "size": "3:2",
  "prompt": "a pineapple, watercolorpainting",
  "style": "nostyle"
})
headers = {
  'Authorization': 'Bearer YOUR_API_KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Task Review:

import requests
import json

url = "https://app.zohal.cloud/api/v1/images/mann-e/quality/review"

payload = json.dumps({
  "task_id": "0df67a0a-b183-4e48-8977-ae880792afdb"
})
headers = {
  'Authorization': 'Bearer YOUR_API_KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Sample Output

Task creation:

{"task_id":"0df67a0a-b183-4e48-8977-ae880792afdb"}

Task review (unfinished):

{"status":"processing"}

Statuses: failed, pending, staged, processing

Task review (finished):

{"urls":["https://mann-e-images.storage.c2.liara.space/6209b321-f436-4bfc-9035-12f22fd121ca_part_0000.png","https://mann-e-images.storage.c2.liara.space/6209b321-f436-4bfc-9035-12f22fd121ca_part_0001.png","https://mann-e-images.storage.c2.liara.space/6209b321-f436-4bfc-9035-12f22fd121ca_part_0002.png","https://mann-e-images.storage.c2.liara.space/6209b321-f436-4bfc-9035-12f22fd121ca_part_0003.png"]}