Skip to content

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).

  1. 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.

  2. 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.

  3. 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/v1

    This URL is your base_url for everything that follows.

  4. 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-..."
  5. 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
    }'

    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"}'
  • model is optional on chat/completion/embedding calls — the endpoint serves one model and fills it in. If set, it must match (GET /v1/models returns the id).
  • Billing is GPU-hour × running replicaspause or delete deployments you’re not using.
  • Unknown OpenAI parameters never error — existing OpenAI code ports as-is.