Skip to content

Documentation Quickstart

Get started

Quickstart

Use an OpenAI-compatible SDK to prepare a server-side client and send a first request.

Before you start#

  1. 01 — CONNECTPrepare an API keyUse the console.
  2. 02 — SET UPInstall an SDKKeep credentials server-side.
  3. 03 — BUILDSend a requestUse the documented model ID.

Prepare an API key#

Open the console and create or copy an API key.

Open console

Shell
export MORPH_API_KEY="your-api-key"

Use API keys only in server environments. Never commit them or expose them to browser code.

Install an SDK#

Install the OpenAI SDK for your server runtime.

pip install openai

Send a request#

POSThttps://api.dev.morphfactory.io/v1/chat/completions
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.dev.morphfactory.io/v1",
    api_key=os.environ["MORPH_API_KEY"],
)
response = client.chat.completions.create(
    model="motif/motif-3",
    messages=[{"role": "user", "content": "Hello, Morph!"}],
)
print(response.choices[0].message.content)