A serverless endpoint gives you one HTTPS address for a model server. GPU workers start when requests arrive and are released when it is quiet, so with a minimum of zero workers you pay nothing while it is idle. If the Endpoints page says endpoints are not available yet, they are not switched on for your account.
How you are billed
There is no price per request. Each worker is an ordinary server, billed by the second at the hourly price of its GPU and disk from the moment it starts, including while it loads the model, until it is released. The price is shown on the endpoint page. See Serverless endpoints.
1. Create an API key
- Open API keys and select Create key.
- Name it
endpoint-testand under Permissions choose Servers. This scope can call an endpoint and wake its workers. - Select Create key, copy the key and keep it safe. It is shown only once.
In your terminal, store it for the commands below:
export APIDLY_API_KEY="paste-your-key-here"2. Create the endpoint
- Open Endpoints and select New endpoint. It has three steps: GPU, Template and Scaling.
- Pick a GPU with VRAM of 16 GB or more and select Next.
- Choose vLLM endpoint worker (OpenAI-compatible) and select Next.
- Name it
chat-endpointand keep the settings: Minimum workers 0, Maximum workers 2, Idle timeout (minutes) 5. - Select Create endpoint.
The worker serves the template's default model, Qwen/Qwen2.5-1.5B-Instruct. The console form has no variables field. To serve another model, create the endpoint with the command-line tool and --env MODEL=....
To limit spending, set Spending cap per hour. The endpoint then never runs more workers than that amount pays for.
3. Find the address
Open the endpoint. The page shows Endpoint URL and OpenAI base URL, code samples in curl, Python and JavaScript, and a Test request box. The base URL looks like this, with your own endpoint id:
https://apidly.com/api/v1/endpoints/EPN_ID/openai/v14. Call it
The first request after an idle period has to wait while a worker starts, finds a machine and loads the model. That can take several minutes. A single request is held for at most 240 seconds, so you may get 503 with a Retry-After header first. That is normal: wait and try again.
curl -i https://apidly.com/api/v1/endpoints/EPN_ID/openai/v1/chat/completions \
-H "Authorization: Bearer $APIDLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "Qwen/Qwen2.5-1.5B-Instruct", "messages": [{"role": "user", "content": "Say hello in five words."}]}'The same call in Python (pip install openai), with a loop that waits for the worker:
import os
import time
from openai import APIStatusError, OpenAI
client = OpenAI(
base_url="https://apidly.com/api/v1/endpoints/EPN_ID/openai/v1",
api_key=os.environ["APIDLY_API_KEY"],
max_retries=0,
)
for attempt in range(60):
try:
reply = client.chat.completions.create(
model="Qwen/Qwen2.5-1.5B-Instruct",
messages=[{"role": "user", "content": "Say hello in five words."}],
)
print(reply.choices[0].message.content)
break
except APIStatusError as e:
if e.status_code != 503:
raise
wait = int(e.response.headers.get("Retry-After", "10"))
print(f"No worker ready yet. Trying again in {wait} s.")
time.sleep(wait)Once a worker is ready, answers come back at once. The Workers list on the endpoint page shows it as ready.
5. Watch it scale to zero
Stop sending requests. After the idle timeout, 5 minutes here, the worker is released and the page shows No workers right now. One starts when a request arrives. From then on the endpoint costs nothing until the next request. To keep one worker ready, raise Minimum workers; you then pay for it all the time.
When you are done: pause or delete
- Pause releases all workers. Requests are refused with
503and nothing is billed. Resume brings it back. - Delete removes the endpoint for good. Requests stop at once and its workers are released within a few minutes. This cannot be undone.
- Avoid Stop for a long break: it keeps the workers' disks, and disks are billed.
From a terminal: apidly endpoints pause EPN_ID or apidly endpoints rm EPN_ID. Also revoke the endpoint-test key on the API keys page if you no longer need it.
Next
Ready to try it?
Create a free account and add credit when you want to start a server. The smallest top-up is $10.
Was this helpful?