YOLOv8
Use the YOLOv8 model family through our Serverless Cloud API
YOLOv8 is an object detection, instance segmentation, and keypoint detection model family from Ultralytics. Roboflow serves COCO-pretrained YOLOv8 checkpoints under short aliases, and you can upload your own weights to run a model you trained elsewhere.
Training YOLOv8 is not supported on Roboflow. For a Roboflow-trained detector, see RF-DETR, YOLO26, or YOLO11.
Pretrained aliases
Pass one of these IDs as model_id to run a COCO-pretrained checkpoint without training anything. The full list lives on the Pretrained Model Aliases page.
Code sample
Get your API Key
Create a Roboflow account, find your key on the Roboflow API settings page and make it available to your shell:
Install the dependencies
Install the Inference SDK and supervision for decoding and drawing predictions:
Run the model
This example runs the pretrained yolov8n-640 checkpoint. To serve your own weights, swap in your {workspace}/{model-slug} ID (see Versions, Trainings, and Models).
Set api_url to match your deployment target:
https://serverless.roboflow.comfor the Serverless Cloud API.http://localhost:9001for a local Inference server.Your Dedicated Deployment URL for a private endpoint.
You can also load the checkpoint in-process with the inference package:
Last updated
Was this helpful?