Set up a new connection
Once a new project with a base map map has been set up, select Layer > Add Layer > Add WMS / WMTS Layer.
Create a new connection
In the Data Source Manager | WMS/WMTS dialog:
In the Create a New WMS/WMTS Connection dialog:
Name: Provide a name for the API.
URL: Copy your OS Maps API WMTS endpoint address from the OS Data Hub and paste it into this field. Your API Key is automatically added to the URL in the key parameter.
Authentication: You can ignore these options. It is not necessary to enter your username and password to use the service as as all authentication is done through your Project key.
Other fields: Leave the rest of the fields as they are.
QGIS Create a New WMS/WMTS dialog
Add Layer
In the Data Source Manager | WMS/WMTS dialog,
Select your new connection in the dropdown.
Select your preferred tileset.
Click Add and then Close to close the dialog_.
QGIS Data Source Manager | WMS/WMTS dialog showing list of OS Maps API tilesets _The layer will then display in the Layers panel and the data will display on the map:
QGIS UI showing OS Maps API in map area