Skip to content

runapi-ai/core-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RunAPI

Shared SDK primitives for RunAPI JavaScript, Python, Ruby, Go, Java, and PHP SDKs.

npm PyPI RubyGems Go Reference Maven Central License


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.

Install

npm install @runapi.ai/core
pip install runapi-core
gem install runapi-core
go get github.com/runapi-ai/core-sdk/go@latest

Gradle:

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.

Use Core Directly

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();

Repository Layout

  • js/ publishes @runapi.ai/core.
  • python/ publishes runapi-core.
  • ruby/ publishes runapi-core.
  • go/ publishes github.com/runapi-ai/core-sdk/go.
  • java/ publishes ai.runapi:runapi-core and ai.runapi:runapi-bom.
  • PHP publishes runapi-ai/core from https://github.com/runapi-ai/core-php.

Public Links

Request identifiers

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.

License

Licensed under the Apache License, Version 2.0.

About

RunAPI core SDK for JavaScript, Python, Ruby, Go, Java, and PHP

Topics

Resources

License

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors