Skip to content

Quickstart

Get started with 638Labs.com APIs

Get An API Key


  1. Visit 638Labs.com and create an account.

  2. Visit the API Keys link on the left sidebar of the account section. Create an API key or use the default created one.

  3. Copy the API key to your clipboard - reveal key in right hand action menu to copy.

  4. In your terminal, set STOLABS_API_KEY environment variable to the API key you copied. NOTE: we use STO as shorthand for 638 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

  1. On the dashboard, click on your Endpoints button.

  2. Click on “New Endpoints”

  3. Add following:

routename = openai/gpt-4o
url = https://api.openai.com/v1/chat/completions
type = AI Model

Note: You can replace gpt-4o with any other compatible OpenAI models you have access to.

Test OpenAI Registry entry

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