Portkey provides a robust and secure gateway to facilitate the integration of various Large Language Models (LLMs) into your applications, including Recraft AI APIs.
With Portkey, you can take advantage of features like fast AI gateway access, observability, prompt management, and more, all while ensuring the secure management of your LLM API keys through a virtual key system.
Provider Slug. recraft-ai
Portkey SDK Integration with Recraft AI Models
Portkey provides a consistent API to interact with models from various providers. Recraft AI currently has
the following models available for integration:
Image Generation on Recraft AI using Portkey
Portkey supports the OpenAI signature to make text-to-image requests.
NodeJS
Python
OpenAI NodeJS
OpenAI Python
cURL
import Portkey from 'portkey-ai';
// Initialize the Portkey client
const portkey = new Portkey({
apiKey: "PORTKEY_API_KEY", // Replace with your Portkey API key
provider: "recraft-ai",
Authorization: "RECRAFT_API_KEY"
});
async function main() {
const image = await portkey.images.generate({
model: "recraftv3",
prompt: "Lucy in the sky with diamonds",
style: 'digital_illustration',
});
console.log(image.data);
}
main();
You’ll find more information in the relevant sections:
- Add metadata to your requests
- Add gateway configs to your Recraft AI requests
- Tracing Recraft AI requests
- Setup a fallback from OpenAI to Recraft AI APIs