diff --git a/website/docs/api-keys.mdx b/website/docs/api-keys.mdx new file mode 100644 index 00000000..1836fdda --- /dev/null +++ b/website/docs/api-keys.mdx @@ -0,0 +1,49 @@ +--- +id: api-keys +--- + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; +import constants from "@site/core/tabConstants"; + +# Manage API keys + +## Get your LastMile API Key + +- Log in or sign up at https://lastmileai.dev +- Navigate to https://lastmileai.dev/apikeys +- Click `+ New Key` + +![LastMile API Key](/img/lastmile-api-key.png) + +## Use your LastMile API Key + +## Managing External API + +### Configure Weights & Biases API token + +![PyPI](https://img.shields.io/pypi/v/lastmile?label=lastmile) + +The [LastMile Python library](https://pypi.org/project/lastmile/) provides pythonic access to the LastMile REST API from any Python 3.7+ application. + +#### Installation + +```bash +# install from PyPI +pip install lastmile +``` + +#### Usage + +```python +import os +from lastmile import Lastmile + +client = Lastmile( + # This is the default and can be omitted + bearer_token=os.environ.get("LASTMILE_API_TOKEN"), +) + +dataset = client.datasets.create() +print(dataset.dataset) +``` diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index fe267ab8..0c0da400 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -66,6 +66,7 @@ const config: Config = { sidebarOptions: { groupPathsBy: "tag", }, + baseUrl: "https://lastmileai.dev", } satisfies OpenApiPlugin.Options, } satisfies Plugin.PluginOptions, }, @@ -73,6 +74,23 @@ const config: Config = { ], themes: ["docusaurus-theme-openapi-docs"], themeConfig: { + languageTabs: [ + { + highlight: "curl", + language: "curl", + logoClass: "curl", + }, + { + highlight: "python", + language: "python", + logoClass: "python", + }, + { + highlight: "javascript", + language: "nodejs", + logoClass: "nodejs", + }, + ], navbar: { logo: { alt: "LastMile AI", diff --git a/website/sidebars.ts b/website/sidebars.ts index 97e18b70..a0f2ca72 100644 --- a/website/sidebars.ts +++ b/website/sidebars.ts @@ -85,7 +85,17 @@ const sidebars: SidebarsConfig = { title: "Overview", description: "Some mock description text here", }, - items: require("./docs/api/sidebar.js"), + items: [ + { + type: "doc", + id: "api-keys", + }, + { + type: "doc", + id: "sdk", + }, + ...require("./docs/api/sidebar.js"), + ], collapsible: true, collapsed: true, }, diff --git a/website/static/img/lastmile-api-key.png b/website/static/img/lastmile-api-key.png new file mode 100644 index 00000000..548f8b92 Binary files /dev/null and b/website/static/img/lastmile-api-key.png differ diff --git a/website/static/open_api/2/model.json b/website/static/open_api/2/model.json index cd797bf8..61a56e84 100644 --- a/website/static/open_api/2/model.json +++ b/website/static/open_api/2/model.json @@ -5,7 +5,19 @@ "description": "LastMile AI API V2: Components", "version": "2.0" }, - "servers": [], + "options": { + "servers": [ + { + "url": "https://lastmileai.dev2", + "description": "REST API surface for the LastMile platform." + } + ] + }, + "servers": [ + { + "url": "https://your-custom-url.com" + } + ], "security": [ { "BearerAuth": []