Shared SDK primitives for RunAPI JavaScript, Python, Ruby, Go, Java, and PHP SDKs.
RunAPI Core SDK contains the shared authentication, HTTP, retry, error, file upload, account, and polling primitives used by RunAPI Provider Client packages. Application code should usually install a concrete Provider Client package such as @runapi.ai/wan, runapi-wan, runapi-ai/wan, github.com/runapi-ai/wan-sdk/go, or ai.runapi:runapi-wan; install core packages directly only when building shared SDK infrastructure.
npm install @runapi.ai/core
pip install runapi-core
gem install runapi-core
go get github.com/runapi-ai/core-sdk/go@latestGradle:
dependencies {
implementation("ai.runapi:runapi-core:0.1.0")
}Maven:
<dependency>
<groupId>ai.runapi</groupId>
<artifactId>runapi-core</artifactId>
<version>0.1.0</version>
</dependency>The PHP core package is published from the split Composer repository as runapi-ai/core; see https://github.com/runapi-ai/core-php for PHP install and examples.
Core is normally transitive from a Provider Client package. Install it directly when you need shared Java exceptions, RequestOptions, files, account, or transport primitives in reusable tooling.
import ai.runapi.core.RequestOptions;
import ai.runapi.core.files.FileCreateParams;
import java.time.Duration;
RequestOptions options = RequestOptions.builder()
.timeout(Duration.ofMinutes(15))
.maxRetries(2)
.build();
FileCreateParams upload = FileCreateParams.fromUrl("https://cdn.runapi.ai/public/samples/input.png")
.fileName("input.png")
.build();js/publishes@runapi.ai/core.python/publishesrunapi-core.ruby/publishesrunapi-core.go/publishesgithub.com/runapi-ai/core-sdk/go.java/publishesai.runapi:runapi-coreandai.runapi:runapi-bom.- PHP publishes
runapi-ai/corefrom https://github.com/runapi-ai/core-php.
- SDK docs: https://runapi.ai/docs#runapi-sdks
- Model catalog: https://runapi.ai/models
- Repository: https://github.com/runapi-ai/core-sdk
RunAPI accepts an optional X-Client-Request-Id header on public API calls. Use printable ASCII values up to 512 characters. Accepted values are echoed in the response and stored with the RunAPI task for support and reconciliation.
await client.textToImage.create(
{ prompt: 'A sunset over the ocean' },
{ headers: { 'X-Client-Request-Id': 'order-123' } }
);Public API responses expose X-RunAPI-Task-Id when a RunAPI task exists. Ruby and Python Provider Client resource methods keep response headers on returned model objects via response_headers and runapi_task_id. Other high-level SDK resource methods expose parsed response bodies; use a custom transport or direct HTTP request when those integrations need raw response headers.
Licensed under the Apache License, Version 2.0.