Skip to main content

Installation

Install the Prompt Foundry SDK NPM version

Integration

The full API of this library can be found in the API Reference page by selecting JavaScript in the interactive examples.

Option 1 - Completion Proxy

This option requires you to add a provider API key in your organization settings.
Initiates a completion request to the configured LLM provider using specified parameters and provided variables. This endpoint abstracts the integration with different model providers, enabling seamless switching between models while maintaining a consistent data model for your application.

Option 2 - Direct Provider Integration

Fetches the configured model parameters and messages rendered with the provided variables mapped to the set LLM provider. This endpoint abstracts the need to handle mapping between different providers, while still allowing direct calls to the providers.

OpenAI Integration

Install the OpenAI SDK
Import the OpenAI and Prompt Foundry SDKs

Anthropic Integration

Install the Anthropic SDK
Import the Anthropic and Prompt Foundry SDKs

Additional Information

For more details, visit the GitHub Repo.