QuickStart - Serverless
This guide takes you from zero to a working OpenAI-compatible endpoint serving a model of your choice.
Prerequisites: a Meshive workspace with credits (QuickStart - Client).
-
Pick a model.
Open Serverless › Models. The Official tab is a verified, 1-click catalog — each card shows the modality, VRAM requirement, and key specs.
Want your own model? Register its Hugging Face repo first — Custom models or the full tutorial.
-
Deploy it.
Click Deploy. The panel lists every GPU candidate that fits, cheapest first, with hourly prices. Four controls:
- Price cap — max per replica-hour; GPUs above it are never assigned. A suggestion is pre-filled.
- Min / max replicas — the range (minimum 1).
- Autoscale — scale within the range by load, or pin to min.
- Output storage (image/video only) — where generated files land; defaults to Managed.
Confirm. The deployment appears on Serving as Creating (first deployments show download progress). Running = the endpoint is live.
-
Copy the endpoint URL.
Every deployment gets its own endpoint, shown at the top of its card on the Serving page:
https://<your-deployment>.inference.meshive.ai/v1This URL is your
base_urlfor everything that follows. -
Create an API key.
Go to Serverless › Models → API Keys and click Create. The plaintext key (
mk-...) is shown once — copy it now. If you lose it, use Regenerate on the same row to get a new one.Terminal window export MESHIVE_API_KEY="mk-..." -
Make a request.
For a chat/LLM deployment:
Terminal window curl https://<your-deployment>.inference.meshive.ai/v1/chat/completions \-H "Authorization: Bearer $MESHIVE_API_KEY" \-H "Content-Type: application/json" \-d '{"messages": [{"role": "user", "content": "Hello! Who are you?"}],"stream": false}'from openai import OpenAIclient = OpenAI(base_url="https://<your-deployment>.inference.meshive.ai/v1",api_key="mk-...",)resp = client.chat.completions.create(model="", # optional — the endpoint already knows its modelmessages=[{"role": "user", "content": "Hello! Who are you?"}],)print(resp.choices[0].message.content)import OpenAI from "openai";const client = new OpenAI({baseURL: "https://<your-deployment>.inference.meshive.ai/v1",apiKey: process.env.MESHIVE_API_KEY,});const resp = await client.chat.completions.create({model: "", // optional — the endpoint already knows its modelmessages: [{ role: "user", content: "Hello! Who are you?" }],});console.log(resp.choices[0].message.content);For an image deployment:
Terminal window curl https://<your-deployment>.inference.meshive.ai/v1/images/generations \-H "Authorization: Bearer $MESHIVE_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<model-id>", "prompt": "A sunset over the ocean", "size": "1024x1024"}'
modelis optional on chat/completion/embedding calls — the endpoint serves one model and fills it in. If set, it must match (GET /v1/modelsreturns the id).- Billing is GPU-hour × running replicas — pause or delete deployments you’re not using.
- Unknown OpenAI parameters never error — existing OpenAI code ports as-is.
Next steps
Section titled “Next steps”- Generate images asynchronously — past the 30s sync budget
- Get a webhook when an async request finishes
- API reference — every endpoint and parameter