Get started with our APIs
Inference TIME💥🔥!
Now that you have your account and API key set up, it's time to try out the models!
Chat Completion
You can see details about this api here: Create Chat Completion API Docs
curl --request POST \
--url https://api.nmesh.io/api/v1/chat/completions \
--header 'Authorization: Bearer YourAPIkey' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"model": "meta-llama/Meta-Llama-3.1-8B-Instruct-Q8",
"messages": [
{
"role": "system",
"content": "You are an AI expert to chat with."
},
{
"role": "user",
"content": "What's your favourite song?"
}
]
}
'
import requests
url = "http://8.211.198.6:80/api/v1/chat/completions"
payload = {
"model": "llama3",
"messages": [
{
"role": "system",
"content": "You are an expert to chat with."
},
{
"role": "user",
"content": "What's your favourite song?"
}
],
"max_tokens": 24,
"temperature": 24,
"top_p": 24,
"top_k": 24,
"repetition_penalty": 24,
"stream": True,
"logprobs": 24,
"echo": False,
"n": 24,
"min_p": 24,
"presence_penalty": 24,
"frequency_penalty": 24
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"Authorization": "Bearer yourAPIkey"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
Image Generation
Stable Diffusion Models
You can see details about this api here: Create Image SD API
curl --request POST \
--url https://api.nmesh.io/api/v1/image/generation/sd \
--header 'Authorization: Bearer YourAPIKey' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"model": "stabilityai/stable-diffusion-xl-base-1.0",
"width": 512,
"height": 512,
"prompt": "A cat"
}
'
 Flux Models
You can find details about this api here: Create Image Flux API
curl --request POST \
--url https://api.nmesh.io/api/v1/image/generation/flux \
--header 'Authorization: Bearer YourAPIKey' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"model": "black-forest-labs/flux-schnell",
"prompt": "A cat"
}
'
API ENDPOINTS
Updated 3 months ago
What’s Next