Quickstart
Get started with 638Labs.com APIs
Get An API Key
-
Visit 638Labs.com and create an account.
-
Visit the API Keys link on the left sidebar of the account section. Create an API key or use the default created one.
-
Copy the API key to your clipboard - reveal key in right hand action menu to copy.
-
In your terminal, set STOLABS_API_KEY environment variable to the API key you copied. NOTE: we use
STO
as shorthand for638
for obvious reasons - not to start an API key with numbers.
export STOLABS_API_KEY=<your-api-key>
Test Request against native 638Labs endpoints
curl -N https://sto0.638labs.com/api/v1 \-H "Content-Type: application/json" \-H "Authorization: Bearer $STOLABS_API_KEY" \-d '{"route": "ndai/prod-v1","payload": { "model": "ndai/prod-v1", "messages": [ { "role": "user", "content": "Hello from the other side." } ], "stream" : false }}'
Next, let’s create your first registry entry.
Use OpenAI to perform a simple cURL
request to the 638Labs.com API.
First registry entry
-
On the dashboard, click on your Endpoints button.
-
Click on “New Endpoints”
-
Add following:
routename = openai/gpt-4ourl = https://api.openai.com/v1/chat/completionstype = AI Model
Note: You can replace gpt-4o
with any other compatible OpenAI models you have access to.
Test OpenAI Registry entry
- Find your 638Labs API key
STOLABS_API_KEY
and your OPENAI API Key -$ENDPOINT_PROVIDER_API_KEY
export STOLABS_API_KEY=<63blabs-api-key>export YOUR_ENDPOINT_PROVIDER_API_KEY=<openai-api-key>
- Make the following
cURL
call in your terminal.
curl -N https://sto0.638labs.com/v1/api/ \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $STOLABS_API_KEY" \ -H "X-Provider-Authorization: Bearer $ENDPOINT_PROVIDER_API_KEY" \ -d '{ "route": "openai/gpt-4o", "payload": { "model": "gpt-4o", "messages": [ { "role": "user", "content": "Write a one-sentence bedtime story about a unicorn." } ], "stream" : false }}'
Note: Streaming is not yet supported.
Next Steps
Create more custom endpoint entries, read the FAQ or about your account endpoints Rate Limits