# Client-Bibliotheken

> Überblick über die verfügbaren Client-Bibliotheken für die Onetime Secret API, darunter Ruby, Python, Perl, Java, C#, Go und mehr.

Der **offizielle Client ist [onetime-ruby](https://github.com/onetimesecret/onetime-ruby)**. Er unterstützt API v1 und v2, alle [regionalen Domains](/en/security/where-your-data-lives/) sowie benutzerdefinierte Basis-URLs.

Alles Weitere auf dieser Seite wird **von der Community gepflegt**. Die meisten dieser Bibliotheken sind älter als API v2 und die regionalen Domains, daher rufen sie in der Regel die veralteten v1-Endpunkte unter `onetimesecret.com` auf. Beachte den Statushinweis zu jedem Eintrag und prüfe, ob eine Bibliothek mit deiner Region oder deiner selbst gehosteten Instanz funktioniert, bevor du dich auf sie verlässt.

| Sprache          | Bibliothek                                                                                              | Letzte Aktivität¹ | Regionale / benutzerdefinierte Domain                        |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Ruby                   | [onetime-ruby](https://github.com/onetimesecret/onetime-ruby) (**offiziell**) | 2026-06                             | ✅ alle Regionen + benutzerdefinierte Basis-URL |
| Go                         | [go-onetimesecret](https://github.com/corbaltcode/go-onetimesecret)                         | 2026-05                             | US-Host                                                                                                            |
| Python             | [onetimesecret-cli](https://github.com/slashpass/onetimesecret-cli)                       | 2024-11                             | Regionsoption US / EU                                                                        |
| Go                         | [otsgo](https://github.com/emdneto/otsgo)                                                                         | 2024-03                             | nicht dokumentiert                                                                             |
| PowerShell | [OneTimeSecret](https://github.com/chelnak/OneTimeSecret)                                         | 2021-06                             | benutzerdefinierte Basis-URL                                               |
| Bash                   | [onetimesecret-bash](https://github.com/eengstrom/onetimesecret-bash)                   | 2020-05                             | benutzerdefinierter Host                                                           |
| Python             | [py_onetimesecret](https://github.com/utterstep/py_onetimesecret)                           | 2019-05                             | ❌ (aus der Python-2-Ära)                                                               |
| C#                         | [OneTimeSharp](https://github.com/utterstep/OneTimeSharp)                                           | 2018-05                             | ❌                                                                                                                              |
| Java                   | [onetime-java](https://github.com/mpawlowski/onetime-java)                                          | 2014-06                             | nur selbst gehostete URL                                                               |
| Perl                   | [Net::OneTimeSecret](https://metacpan.org/pod/Net::OneTimeSecret)                       | 2012-02                             | ❌                                                                                                                              |

¹ Letzter Commit oder letztes Release zum Zeitpunkt der letzten Prüfung (2026-07).

## Ruby

[GitHub-Seite - onetime-ruby](https://github.com/onetimesecret/onetime-ruby) von [Delano](https://delanotes.com/) — **offizieller Client**, aktiv gepflegt (letzter Commit 2026-06). Unterstützt API v1 (veraltet) und v2, regionale Domains und benutzerdefinierte Basis-URLs. Benötigt Ruby 3.1+, keine Laufzeitabhängigkeiten.

### Anwendungsbeispiel

```ruby
require 'onetime/api'


api = Onetime::API.new('YOUR_EMAIL', 'YOUR_OTS_APIKEY')
options = {
  secret: 'Jazz, jazz and more jazz.',
  recipient: 'example@onetimesecret.com',
  ttl: 7200
}


ret = api.post('/share', options)
puts ret['secret_key']
```

***

## Python

[GitHub-Seite - onetimesecret-cli](https://github.com/slashpass/onetimesecret-cli) von [slashpass](https://github.com/slashpass) — von der Community gepflegt (letzter Commit 2024-11). Unterstützt eine Regionsoption (`us` / `eu`).

### Anwendungsbeispiel

```python
from onetimesecret import OneTimeSecretCli


cli = OneTimeSecretCli(ONETIMESECRET_USER, ONETIMESECRET_KEY)
cli.create_link("secret") # return a link like https://onetimesecret.com/secret/xxxxxxxxxxx
```

[GitHub-Seite - py_onetimesecret](https://github.com/utterstep/py_onetimesecret) von [Vladislav Stepanov](https://github.com/utterstep) — **nicht mehr gepflegt** (letzter Commit 2019; das Beispiel unten ist Python 2). Verwendet ausschließlich die veraltete v1-API unter `onetimesecret.com`.

### Anwendungsbeispiel

```python
from onetimesecret import OneTimeSecret


o = OneTimeSecret("YOUR_EMAIL", "YOUR_OTS_APIKEY")
secret = o.share(u"test")


print o.retrieve_secret(secret["secret_key"])
# {u'secret_key': u'dtr7ixukiolpx1i4i87kahmhyoy2q65',
# u'value': u'test'}
```

***

## Perl

[Net::OneTimeSecret auf CPAN](https://metacpan.org/pod/Net::OneTimeSecret) von [Kyle Dawkins](http://www.shoffle.com/) — **nicht mehr gepflegt** (letztes Release 0.04, 2012-02). Älter als API v2 und die regionalen Domains.

### Anwendungsbeispiel

```perl
#!/usr/bin/env perl


use Net::OneTimeSecret;


# Note: replace these with yours in order for this to work!
my $customerId  = 'YOUR_EMAIL';
my $testApiKey  = 'YOUR_OTS_APIKEY';


my $api = Net::OneTimeSecret->new( $customerId, $testApiKey );
my $result = $api->shareSecret( 'Jazz, jazz and more jazz.',
                   passphrase => 'thepassword',
                   recipient => 'kyle@shoffle.com',
                   ttl => 7200,
                 );
printf( "%s\n", $result->{secret_key} );


my $secret = $api->retrieveSecret( $result->{secret_key}, passphrase => "thepassword" );
printf( "%s\n", $secret->{value} );
```

***

## Java

[GitHub-Seite - onetime-java](https://github.com/mpawlowski/onetime-java) von [Marcin Pawlowski](https://github.com/mpawlowski) — **nicht mehr gepflegt** (letzter Commit 2014-06). Nimmt eine Instanz-URL entgegen und funktioniert daher möglicherweise mit selbst gehosteten Instanzen, ist aber älter als API v2.

### Anwendungsbeispiel

```java
OneTimeSecret ots = new OneTimeSecretRestImpl(
    "https://path/to/ots/instance",
    "ots-username",
    "ots-apikey");


GenerateResponse generateResponse = ots.generate(
                new GenerateRequest.Builder()
                        .withPassphrase("supersecret")
                        .build());


RetrieveResponse retrieveResponse = ots.retrieve(
                new RetrieveRequest.Builder()
                        .withSecretKey(generateResponse.getSecretKey())
                        .withPassphrase("supersecret")
                        .build());


assertEquals(generateResponse.getValue(), retrieveResponse.getValue());
```

***

## C\#

[GitHub-Seite - OneTimeSharp](https://github.com/utterstep/OneTimeSharp) von [Vladislav Stepanov](https://github.com/utterstep) — **nicht mehr gepflegt** (letzter Commit 2018-05). Verwendet ausschließlich die veraltete v1-API unter `onetimesecret.com`.

### Anwendungsbeispiel

```csharp
// You can use OneTimeSharp in any of your projects which are compatible with .NET (4.0+) or Mono (2.10.8+).
using VStepanov.OneTimeSharp;


class Test
{
    static void Main(string[] args)
    {
        var ots = new OneTimeSecret("YOUR_EMAIL", "YOUR_OTS_APIKEY");


        var generated = ots.GenerateSecret();


        Console.WriteLine(generated.Value); // LR*?us*A(UT*


        Console.WriteLine(generated.SecretKey); // ikzx3m77j5by8411cg5lk5fvfylvl0i
        Console.WriteLine(ots.GetSecretLink(generated)); // https://onetimesecret.com/secret/ikzx3m77j5by8411cg5lk5fvfylvl0i


        var shared = ots.ShareSecret("Hello, OTS!");


        Console.WriteLine(shared.MetadataKey); // kd6rgsucl98qbgu9eavjq4k5sdxsom0
        Console.WriteLine(ots.GetMetadataLink(shared)); // https://onetimesecret.com/private/kd6rgsucl98qbgu9eavjq4k5sdxsom0
    }
}
```

***

## Go

[GitHub-Seite - go-onetimesecret](https://github.com/corbaltcode/go-onetimesecret) von [Corbalt](https://github.com/corbaltcode/) — von der Community gepflegt (letzter Commit 2026-05, aktualisiert für den Host `us.onetimesecret.com`). Enthält eine CLI.

### Anwendungsbeispiel

```go
import ots "github.com/corbaltcode/go-onetimesecret"


client := ots.Client{
  Username: "user@example.com",
  Key: "my api key",
}


metadata, err := client.Put("the launch codes", "passphrase", 0, "")
if err != nil {
  // handle error
}


secret, err := client.Get(metadata.SecretKey, "passphrase")
if err != nil {
  // handle error
}


// prints "the launch codes"
print(secret)
```

### Anwendungsbeispiel als CLI

```bash
$ go install github.com/corbaltcode/go-onetimesecret/cmd/ots@latest


$ ots put 'what is essential is invisible to the eye'
hdjk6p0ozf61o7n6pbaxy4in8zuq7sm ifipvdpeo8oy6r8ryjbu8y7rhm9kty9


$ ots get hdjk6p0ozf61o7n6pbaxy4in8zuq7sm
what is essential is invisible to the eye


$ ots gen
rVjbS$twCJkS 4nwhy7v4fnabayqc5auv4ogh0nfr20 flsdlaun6hwczqu9utmc0vts5xj9xu1


$ ots burn flsdlaun6hwczqu9utmc0vts5xj9xu1
flsdlaun6hwczqu9utmc0vts5xj9xu1
```

***

## Go (lib)

[GitHub-Seite - otsgo](https://github.com/emdneto/otsgo) von [Emídio Neto](https://github.com/emdneto) — von der Community gepflegt (letztes Release v1.1.0, 2024-03). Unterstützung regionaler Domains nicht dokumentiert.

### Anwendungsbeispiel

```go
// Build a new client
client := ots.NewClient(
      WithUsername("otsuser@domain.com"),
      WithApiKey("xxxxxxxx"),
)


// Send a request with context
ctx := context.Background()
response, err := client.GetStatus(ctx)
if err != nil {
      panic(err)
}


fmt.Println(response.Status)
```

***

## PowerShell

[GitHub-Seite - OneTimeSecret](https://github.com/chelnak/OneTimeSecret) von [Craig Gumbley](https://www.helloitscraig.co.uk) — **nicht mehr gepflegt** (letztes Release 2021-06). Unterstützt eine benutzerdefinierte `-BaseUrl` und kann daher auf eine Region oder eine selbst gehostete Instanz zeigen, ist aber älter als API v2.

### Anwendungsbeispiel

```powershell
# Install from the PowerShell gallery
Install-Module -Name OneTimeSecret -Scope CurrentUser


# Set connection information
Set-OTSAuthorizationToken -Username user@mail.com -APIKey xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


# Generate a new shared secret
New-OTSSharedSecret -Secret "Very Secret" -Passphrase 1234 -Recipient user@mail.com


# Retrieve a secret
Get-OTSSecret -SecretKey qqevnp70b4uoiax4knzhwlhros6ne7x -Passphrase 1234


# View all functions that are available
Get-Command -Module OneTimeSecret | Select Name
```

***

## Bash

[GitHub-Seite - onetimesecret-bash](https://github.com/eengstrom/onetimesecret-bash) von [Eric Engstrom](https://eengstrom.github.io/) — **nicht mehr gepflegt** (letzter Commit 2020-05). Unterstützt über `ots_set_host` einen benutzerdefinierten Host, ist aber älter als API v2 und die regionalen Domains.

### Anwendungsbeispiel als Scripting-API

```bash
# source for use anonymously (secrets created anonymously)
source ots.bash


# or, source with specific auth credentials
APIUSER="USERNAME"
APIKEY="APIKEY"
source ots.bash -u $APIUSER -k $APIKEY


# check status of server
ots_status


# create a secret and get back the URL
URL=$(echo "secret" | ots_share)


# share a multi line secret via HEREDOC.
URL=$(ots_share <<-EOF
      This is a Secret
      ... on multiple lines
EOF
)


# pass options to share or generate.
URL=$(ots_share ttl=600 \
                  passphrase="shared-secret" \
                  recipient="someone@somewhere.com" <<< "SECRET")


# fetch the secret data
local DATA="$(ots_retrieve "$URL")"


# share/generate a new secret, and get back the private metadata key
local KEY=$(ots_metashare <<< "SECRET")
local KEY=$(ots_metagenerate)


# get a list of private metadata keys recently created.
# note that this requires valid authentication credentials
local -a RECENT=( $(ots_recent) )


# check on the current state of a secret, given the private key
ots_state $KEY


# burn a secret, given the private key
ots_burn $KEY
```

### Anwendungsbeispiel als CLI

```bash
# Share a secret (from stdin)
./ots share
SECRET
^D


# Share a secret (via HEREDOC)
./ots share <<-EOF
      This is a multi-line secret via HEREDOC.
      Something else goes here.
EOF


# Get/Retrieve a secret:
./ots get <key|url>
./ots retrieve <key|url>


# Burn a secret, given its private metadata key:
./ots burn <key>
```