Integrate Upstage with Portkey AI for seamless completions, prompt management, and advanced features like streaming and embedding.
Portkey Provider Slug: upstage
Portkey offers native integrations with Upstage for Node.js, Python, and REST APIs. By combining Portkey with Upstage, you can create production-grade AI applications with enhanced reliability, observability, and advanced features.
Obtain your Upstage API Key
Visit the Upstage dashboard to generate your API key.
Create a Virtual Key in Portkey
Portkey’s virtual key vault simplifies your interaction with Upstage. Virtual keys act as secure aliases for your actual API keys, offering enhanced security and easier management through budget limits to control your API usage.
Use the Portkey app to create a virtual key associated with your Upstage API key.
Initialize the Portkey Client
Now that you have your virtual key, set up the Portkey client:
Use the Portkey API key and the Upstage virtual key to initialize the client in your preferred programming language.
Alternatively, use Portkey’s Open Source AI Gateway to enhance your app’s reliability with minimal code:
🔥 That’s it! You’ve integrated Portkey into your application with just a few lines of code. Now let’s explore making requests using the Portkey client.
Supported Upstage Models
Chat
- solar-pro, solar-mini and solar-mini-ja
Embedding
- embedding-passage, embedding-query
Endpoint | Supported Parameters |
---|---|
chatComplete | messages, max_tokens, temperature, top_p, stream, presence_penalty, frequency_penalty |
embed | model, input, encoding_format, dimensions, user |
Generate chat completions using Upstage models through Portkey:
Stream responses for real-time output in your applications:
Leverage Upstage’s function calling capabilities through Portkey:
Generate embeddings for text using Upstage embedding models:
Portkey allows you to track user IDs passed with the user parameter in Upstage requests, enabling you to monitor user-level costs, requests, and more:
When you include the user parameter in your requests, Portkey logs will display the associated user ID, as shown in the image below:
In addition to the user
parameter, Portkey allows you to send arbitrary custom metadata with your requests. This powerful feature enables you to associate additional context or information with each request, which can be useful for analysis, debugging, or other custom use cases.
Here’s a simplified version of how to use Portkey’s Gateway Configuration:
You can create a Gateway configuration using the Portkey Config Dashboard or by writing a JSON configuration in your code. In this example, requests are routed based on the user’s subscription plan (paid or free).
When a user makes a request, it will pass through Portkey’s AI Gateway. Based on the configuration, the Gateway routes the request according to the user’s metadata.
Pass the Gateway configuration to your Portkey client. You can either use the config object or the Config ID from Portkey’s hosted version.
That’s it! Portkey seamlessly allows you to make your AI app more robust using built-in gateway features. Learn more about advanced gateway features:
Distribute requests across multiple targets based on defined weights.
Automatically switch to backup targets if the primary target fails.
Route requests to different targets based on specified conditions.
Enable caching of responses to improve performance and reduce costs.
Portkey’s AI gateway enables you to enforce input/output checks on requests by applying custom hooks before and after processing. Protect your user’s/company’s data by using PII guardrails and many more available on Portkey Guardrails:
Explore Portkey’s guardrail features to enhance the security and reliability of your AI applications.
The complete list of features supported in the SDK are available in our comprehensive documentation:
Explore the full capabilities of the Portkey SDK and how to leverage them in your projects.
Portkey does not support the following Upstage features:
For the most up-to-date information on supported features and endpoints, please refer to our API Reference.