Loading...
Loading...
Compare original and translation side by side
PREREQUISITE: Runfirst to ensure the project has server-side capability.+check-compatibility
前置条件: 先运行确保项目具备服务端能力。+check-compatibility
npm install @runwayml/sdknpm install @runwayml/sdkpip install runwaymlpip install runwaymlRUNWAYML_API_SECRETRUNWAYML_API_SECRET.env.env.envRUNWAYML_API_SECRET=your_api_key_here.env.envdotenvnpm install dotenvimport 'dotenv/config';python-dotenvpip install python-dotenvfrom dotenv import load_dotenv
load_dotenv().envRUNWAYML_API_SECRET=your_api_key_here.env.envdotenvnpm install dotenvimport 'dotenv/config';.envpython-dotenvpip install python-dotenvfrom dotenv import load_dotenv
load_dotenv()export RUNWAYML_API_SECRET=your_api_key_hereexport RUNWAYML_API_SECRET=your_api_key_here// Node.js
const client = new RunwayML({ apiKey: 'your_api_key_here' });undefined// Node.js
const client = new RunwayML({ apiKey: 'your_api_key_here' });undefined
**Warn the user:** Never hardcode keys in source code. Use environment variables or a secrets manager.
**警告用户:** 绝对不要在源代码中硬编码密钥,请使用环境变量或密钥管理工具。.env.gitignore.env
.env.local
.env.*.local.gitignore.env.gitignore.env
.env.local
.env.*.local.gitignoreimport RunwayML from '@runwayml/sdk';
const client = new RunwayML();
// If no error is thrown, the API key is configured correctly
console.log('Runway SDK initialized successfully');import RunwayML from '@runwayml/sdk';
const client = new RunwayML();
// 如果没有抛出错误,说明API密钥配置正确
console.log('Runway SDK initialized successfully');from runwayml import RunwayML
client = RunwayML()from runwayml import RunwayML
client = RunwayML()undefinedundefined// Node.js - check organization info
const response = await fetch('https://api.dev.runwayml.com/v1/organization', {
headers: {
'Authorization': `Bearer ${process.env.RUNWAYML_API_SECRET}`,
'X-Runway-Version': '2024-11-06'
}
});
const org = await response.json();
console.log('Credits:', org.creditBalance);// Node.js - 查询组织信息
const response = await fetch('https://api.dev.runwayml.com/v1/organization', {
headers: {
'Authorization': `Bearer ${process.env.RUNWAYML_API_SECRET}`,
'X-Runway-Version': '2024-11-06'
}
});
const org = await response.json();
console.log('Credits:', org.creditBalance);.env.gitignore.env.gitignore+integrate-video+integrate-image+integrate-audio+integrate-uploads+integrate-video+integrate-image+integrate-audio+integrate-uploads