API
POST
https://api.genartapi.com/imagine
Request Example:
Make sure you also passed servier_id, channel_id, discord_token and (our) apiKey.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import axios from 'axios';
const API_KEY = 'YOUR_API_KEY'; // Replace 'YOUR_API_KEY' with your actual API key
const fetchImage = async () => {
try {
const response = await axios.get('https://api.genartapi.com/images', {
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <your-midjourney-api-key>",
"server_id": "<servier_id>",
"channel_id": "<channel_id>",
"discord_token": "<discord_token>",
},
});
console.log(response.data);
// Process the image data here
} catch (error) {
console.error('Error fetching image:', error);
}
};
fetchImage();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import requests
API_KEY = 'YOUR_API_KEY' # Replace 'YOUR_API_KEY' with your actual API key
URL = 'https://api.genartapi.com/images'
def fetch_image():
try:
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <your-midjourney-api-key>",
"server_id": "<servier_id>",
"channel_id": "<channel_id>",
"discord_token": "<discord_token>",
}
response = requests.get(URL, headers=headers)
response.raise_for_status() # Raise error for unsuccessful requests
print(response.json())
# Process the image data here
except requests.exceptions.RequestException as e:
print('Error fetching image:', e)
fetch_image()
three!