Configuring the HTTP API
Configuring the HTTP API
Overview
These docs are for version 1.x of Rasa Open Source.
You can run a simple HTTP server that handles requests using your trained Rasa model with:
rasa run -m models --enable-api --log-file out.log
All the endpoints this API exposes are documented in HTTP API.
The different parameters are:
-m: the path to the folder containing your Rasa model,--enable-api: enable this additional API,--log-file: the path to the log file.
Fetching Models from a Server
You can configure the HTTP server to fetch models from another URL:
rasa run --enable-api --log-file out.log --endpoints my_endpoints.yml
The model server is specified in the endpoint configuration (my_endpoints.yml), where you specify the server URL Rasa regularly queries for zipped Rasa models:
models:
url: http://my-server.com/models/default@latest
wait_time_between_pulls: 10 # [optional](default: 100)
Fetching Models from a Remote Storage
You can also configure the Rasa server to fetch your model from a remote storage:
rasa run -m 20190506-100418.tar.gz --enable-api --log-file out.log --remote-storage aws
Configuring SSL / HTTPS
By default the Rasa server is using HTTP for its communication. To secure the communication with SSL, you need to provide a valid certificate and the corresponding private key file.
You can specify these files as part of the rasa run command:
rasa run --ssl-certificate myssl.crt --ssl-keyfile myssl.key
Security Considerations
We recommend to not expose the Rasa Server to the outside world, but rather connect to it from your backend over a private connection (e.g. between docker containers).
Token Based Auth:
rasa run \
-m models \
--enable-api \
--log-file out.log \
--auth-token thisismysecret
Endpoint Configuration
To connect Rasa to other endpoints, you can specify an endpoint configuration within a YAML file.
Then run Rasa with the flag --endpoints <path to endpoint configuration.yml>.
rasa run \
--m <Rasa model> \
--endpoints <path to endpoint configuration>.yml
Connecting a Tracker Store
To configure a tracker store within your endpoint configuration, see Tracker Stores.
Connecting an Event Broker
To configure an event broker within your endpoint configuration, see Event Brokers.
👋 I can help you get started with Rasa and answer your technical questions.