OpenAI-hosted sandboxes
Configure the managed environment used by an agent session.
openai_hosted is the Agents API protocol value for a managed environment. When your client connects to Rebyte, Rebyte provisions and operates the Sandbox. The name is retained for protocol compatibility.
Create a managed environment
const session = await client.beta.agents.sessions.create({
agent: { model: 'glm-5.3', instructions: 'Work in /workspace.' },
environment: {
type: 'openai_hosted',
files: [{
type: 'inline', path: '/workspace/input.txt',
data: Buffer.from('Hello from your application').toString('base64'),
}],
packages: { python: ['pandas'], npm: [], system: [] },
setup_commands: [{ command: 'mkdir -p /workspace/outputs', cwd: '/workspace' }],
network: { access: 'enabled' },
},
});
Each Session gets its own Environment and fixed Sandbox binding. Files and processes are not shared merely because two Sessions use the same saved Agent.
Configure dependencies
Use packages.python, packages.npm, and packages.system to prepare dependencies. Rebyte installs Node packages using pnpm. Use setup_commands for Session-specific preparation and env for setup environment variables.
Paths must be within /workspace. Set up the binaries and dependencies used by stdio MCP servers before those servers execute.
Add skills
The development implementation accepts inline skills through environment.skills. Each entry has a name, description, and base64-encoded ZIP source:
const skill = {
type: 'inline',
name: 'reporting',
description: 'Instructions for preparing reports.',
source: {
type: 'base64', media_type: 'application/zip',
data: skillZipBase64,
},
};
Supply the encoded archive as skillZipBase64 and include the entry in environment.skills. capability_directories selects directories in the Session environment used to load capabilities. OpenAI's own skill-reference mechanism and Plugins are not supported.
Rebyte extension: alongside inline ZIP skills, environment.skills also accepts type: "github" to install a skill from a public GitHub repository or directory at Session initialization, without downloading it at Session-creation time:
{
environment: {
type: 'openai_hosted',
skills: [
{ type: 'github', url: 'https://github.com/vercel-labs/skills', name: 'find-skills' },
],
},
}
A bare repository URL requires name; a directory URL (including a commit-pinned tree/<sha>/... path) must resolve exactly one skill and name is then optional. Only HTTPS GitHub URLs are accepted, and URLs containing embedded credentials are rejected. This is not part of the OpenAI schema — official SDK users can still send it through the SDK's raw request method, since the generated skill union does not include this variant. Pin a commit-based directory URL for reproducible contents; resuming a Session never re-installs or refreshes the source.
Limits
File-ID attachments are not implemented. Inline files are limited to approximately 5 MiB each. Inline skill archives may expand to at most 2,000 entries and 50 MiB. The HTTP body limit is 50 MiB.
Continue with Sandbox lifecycle and Files and artifacts.