Morpheus API Gateway Open Beta - How To Use Swagger UI
The purpose of this document is to provide instructions for how to use the Morpheus API Gateway via the "Swagger UI". We will also be launching a "playground" and improved front-facing UI to more easily interact with the Morpheus API Gateway in a user friendly fashion [coming soon].
The Morpheus API Gateway works in mostly the same way as other OpenAI API compatible inference providers. Once you've finished your configuration, you will simply have an API Key that can be used with any OpenAI API compatible integration alongside the Morpheus Base URL.
API Gateway base URL: https://api.mor.org/api/v1
API Gateway "Swagger UI": https://api.mor.org/docs
You should consider API gateway configuration in 3 steps:
- Auth: Account Creation, Login, API Key Generation
- Config: Choose Model, Set Automation or Create Session
- Chat: Send prompts to chat/completions
Step-by-Step Guide:
Step 1: Access Swagger UI
Go to https://api.mor.org/docs to access the swagger UI. This is the home where you will be configuring all of your settings.

Step 2: Register a User
You will need to register a user. Go to "POST" /api/v1/auth/register and choose your credentials for the gateway. Execute in Swagger or via the cURL request.

curl -X 'POST' \ 'https://api.mor.org/api/v1/auth/register' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "email": "user100@example.com", "name": "string", "is_active": true, "password": "stringst" }'
Your response will be similar to this:
{ "email": "user100@example.com", "name": "string", "is_active": true, "id": 6 }
Step 3: Login to Get Authorization Token
Now you can "login" to your account to get your authorization token. Go to "POST" /api/v1/auth/login and enter your credentials.

curl -X 'POST' \ 'https://api.mor.org/api/v1/auth/login' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "email": "user100@example.com", "password": "stringst" }'
Your response will be similar to this:
{ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDYwNDc2NTMsInN1YiI6IjYiLCJ0eXBlIjoiYWNjZXNzIn0.uG0yuuBseMYyaFbEFjr7boRgWr7wPdFt8laMLMyuZJU", "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDY2NTA2NTMsInN1YiI6IjYiLCJ0eXBlIjoicmVmcmVzaCJ9.WdKfk6YNeD9xqrqr9pNm8cO74IcZ90gUr_9hNkb1_FA", "token_type": "bearer" }
Step 4: Authenticate in Swagger UI
Copy your access token from your response. You will need to authenticate within Swagger or include this access token within your cURL requests. For swagger, click the lock button on the top right and enter the "access_token" key.

Step 5: Generate API Key
Now that you have an auth key, you can generate your API key. Go to "POST" /api/v1/auth/keys and choose a key name, click execute or use CURL.

curl -X 'POST' \ 'https://api.mor.org/api/v1/auth/keys' \ -H 'accept: application/json' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDYwNDc2NTMsInN1YiI6IjYiLCJ0eXBlIjoiYWNjZXNzIn0.uG0yuuBseMYyaFbEFjr7boRgWr7wPdFt8laMLMyuZJU' \ -H 'Content-Type: application/json' \ -d '{ "name": "string" }'
Your response will be similar to this:
{ "key": "sk-WlM8yQ.46cd2cd37987ad4bb02050bd30e783d52088dd4326202c2f6fce0a53e62c9ec5", "key_prefix": "sk-WlM8yQ", "name": "string" }
Step 6: Check Available Models
Now you're ready to check out the models that are available within the compute router. Go to "GET" /api/v1/models and click execute to see the list of models.

Congratulations!
You've successfully made your first chat request and received a response! Congratulations on sourcing inference through the Morpheus Compute Marketplace via the Morpheus API Gateway.
Remember to use the following settings with an OpenAI API Compatible integration:
- API Gateway "Swagger UI": https://api.mor.org/docs
- API Gateway base URL: https://api.mor.org/api/v1
- API_KEY: [Identified in step 5]