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.
Portkey provides a consistent API to interact with models from various providers. Recraft AI currently has
the following models available for integration:
Portkey supports the OpenAI signature to make text-to-image requests.
Copy
Ask AI
import Portkey from 'portkey-ai';// Initialize the Portkey clientconst 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: