multimodal/tarko/llm/examples/README.md
This guide provides an overview of the developer links and call methods for common models.
export OPENAI_API_KEY=x
export ANTHROPIC_API_KEY=y
| Type | URL |
|---|---|
| GET API KEYS | https://platform.openai.com/api-keys |
| API Documentation | https://platform.openai.com/docs/api-reference/introduction |
| OpenAPI Specification | https://github.com/openai/openai-openapi |
| Github | https://github.com/openai/openai-node |
| NPM | https://www.npmjs.com/openai-node |
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});
const response = await client.responses.create({
model: 'gpt-4o',
instructions: 'You are a coding assistant that talks like a pirate',
input: 'Are semicolons optional in JavaScript?',
});
console.log(response.output_text);
import { GoogleGenAI } from '@google/genai';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
async function main() {
const response = await ai.models.generateContent({
model: 'gemini-2.0-flash',
contents: 'Explain how AI works',
});
console.log(response.text);
}
await main();
[!WARNING] What's the difference between these two packages?