Back to Baml

Using Openapi

fern/01-guide/functions/using-openapi.mdx

0.222.01.4 KB
Original Source

Learn how to use your OpenAPI client to call your functions in Boundary Functions.

<Info> This page assumes you've already deployed your BAML code to Boundary Functions. If you haven't done that yet, check out the guide for [getting started](/guide/cloud/functions/get-started). </Info> <Info> This page assumes you're using an OpenAPI-generated BAML client. If you haven't done that yet, check out the [OpenAPI quickstart](/docs/get-started/quickstart/openapi). </Info>

Create an API key

You can create API keys in the Boundary Dashboard by going to the left sidebar and clicking on the key icon.

<div class="flex flex-col items-center"> </div>

Once you've created a new key, update your application code to use it as BOUNDARY_API_KEY.

Update your application code

You also need to update your application code to use BOUNDARY_ENDPOINT and BOUNDARY_API_KEY, if set, when constructing the OpenAPI client.

<Markdown src="../../snippets/openapi-howto-rely-on-envvars.mdx" />

Set your environment variables

You can now set the following environment variables in your application:

bash
BOUNDARY_API_KEY=...
BOUNDARY_ENDPOINT=https://api2.boundaryml.com/v3/functions/prod/

Call your functions

You should now be able to call your deployed BAML functions using your OpenAPI client!