Librerie client
Il client ufficiale è onetime-ruby, che supporta le API v1 e v2, tutti i domini regionali e URL di base personalizzati.
Tutto il resto in questa pagina è mantenuto dalla community. La maggior parte di queste
librerie è precedente all’API v2 e ai domini regionali, quindi di norma chiama gli endpoint
v1 deprecati su onetimesecret.com: controlla la nota sullo stato di ogni voce e
verifica che una libreria funzioni con la tua regione o con la tua istanza
self-hosted prima di farci affidamento.
| Linguaggio | Libreria | Ultima attivit๠| Regione / dominio personalizzato |
|---|---|---|---|
| Ruby | onetime-ruby (ufficiale) | 2026-06 | ✅ tutte le regioni + URL di base personalizzato |
| Go | go-onetimesecret | 2026-05 | host US |
| Python | onetimesecret-cli | 2024-11 | opzione regione US / EU |
| Go | otsgo | 2024-03 | non documentato |
| PowerShell | OneTimeSecret | 2021-06 | URL di base personalizzato |
| Bash | onetimesecret-bash | 2020-05 | host personalizzato |
| Python | py_onetimesecret | 2019-05 | ❌ (epoca Python 2) |
| C# | OneTimeSharp | 2018-05 | ❌ |
| Java | onetime-java | 2014-06 | solo URL self-hosted |
| Perl | Net::OneTimeSecret | 2012-02 | ❌ |
¹ Commit o release più recente al momento dell’ultima verifica (2026-07).
Pagina GitHub - onetime-ruby di Delano — client ufficiale, mantenuto attivamente (ultimo commit 2026-06). Supporta l’API v1 (deprecata) e l’API v2, i domini regionali e gli URL di base personalizzati. Richiede Ruby 3.1+, nessuna dipendenza a runtime.
Esempio di utilizzo
Sezione intitolata “Esempio di utilizzo”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']Pagina GitHub - onetimesecret-cli
di slashpass — mantenuta dalla community (ultimo
commit 2024-11). Supporta un’opzione per la regione (us / eu).
Esempio di utilizzo
Sezione intitolata “Esempio di utilizzo”from onetimesecret import OneTimeSecretCli
cli = OneTimeSecretCli(ONETIMESECRET_USER, ONETIMESECRET_KEY)cli.create_link("secret") # return a link like https://onetimesecret.com/secret/xxxxxxxxxxxPagina GitHub - py_onetimesecret
di Vladislav Stepanov — non più mantenuta (ultimo
commit 2019; l’esempio qui sotto è in Python 2). Usa l’API v1 deprecata solo su
onetimesecret.com.
Esempio di utilizzo
Sezione intitolata “Esempio di utilizzo”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'}Net::OneTimeSecret su CPAN di Kyle Dawkins — non più mantenuta (ultima release 0.04, 2012-02). Precedente all’API v2 e ai domini regionali.
Esempio di utilizzo
Sezione intitolata “Esempio di utilizzo”#!/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} );Pagina GitHub - onetime-java di Marcin Pawlowski — non più mantenuta (ultimo commit 2014-06). Accetta l’URL di un’istanza, quindi può funzionare in self-hosting, ma è precedente all’API v2.
Esempio di utilizzo
Sezione intitolata “Esempio di utilizzo”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());Pagina GitHub - OneTimeSharp
di Vladislav Stepanov — non più mantenuta (ultimo
commit 2018-05). Usa l’API v1 deprecata solo su onetimesecret.com.
Esempio di utilizzo
Sezione intitolata “Esempio di utilizzo”// 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 }}Pagina GitHub - go-onetimesecret
di Corbalt — mantenuta dalla community (ultimo
commit 2026-05, aggiornata per l’host us.onetimesecret.com). Include una CLI.
Esempio di utilizzo
Sezione intitolata “Esempio di utilizzo”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)Esempio di utilizzo come CLI
Sezione intitolata “Esempio di utilizzo come CLI”$ go install github.com/corbaltcode/go-onetimesecret/cmd/ots@latest
$ ots put 'what is essential is invisible to the eye'hdjk6p0ozf61o7n6pbaxy4in8zuq7sm ifipvdpeo8oy6r8ryjbu8y7rhm9kty9
$ ots get hdjk6p0ozf61o7n6pbaxy4in8zuq7smwhat is essential is invisible to the eye
$ ots genrVjbS$twCJkS 4nwhy7v4fnabayqc5auv4ogh0nfr20 flsdlaun6hwczqu9utmc0vts5xj9xu1
$ ots burn flsdlaun6hwczqu9utmc0vts5xj9xu1flsdlaun6hwczqu9utmc0vts5xj9xu1Go (lib)
Sezione intitolata “Go (lib)”Pagina GitHub - otsgo di Emídio Neto — mantenuta dalla community (ultima release v1.1.0, 2024-03). Supporto ai domini regionali non documentato.
Esempio di utilizzo
Sezione intitolata “Esempio di utilizzo”// Build a new clientclient := ots.NewClient( WithUsername("otsuser@domain.com"), WithApiKey("xxxxxxxx"),)
// Send a request with contextctx := context.Background()response, err := client.GetStatus(ctx)if err != nil { panic(err)}
fmt.Println(response.Status)PowerShell
Sezione intitolata “PowerShell”Pagina GitHub - OneTimeSecret
di Craig Gumbley — non più mantenuta (ultima
release 2021-06). Supporta un -BaseUrl personalizzato, quindi può puntare a una regione o
a un’istanza self-hosted, ma è precedente all’API v2.
Esempio di utilizzo
Sezione intitolata “Esempio di utilizzo”# Install from the PowerShell galleryInstall-Module -Name OneTimeSecret -Scope CurrentUser
# Set connection informationSet-OTSAuthorizationToken -Username user@mail.com -APIKey xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Generate a new shared secretNew-OTSSharedSecret -Secret "Very Secret" -Passphrase 1234 -Recipient user@mail.com
# Retrieve a secretGet-OTSSecret -SecretKey qqevnp70b4uoiax4knzhwlhros6ne7x -Passphrase 1234
# View all functions that are availableGet-Command -Module OneTimeSecret | Select NamePagina GitHub - onetimesecret-bash
di Eric Engstrom — non più mantenuta (ultimo
commit 2020-05). Supporta un host personalizzato tramite ots_set_host, ma è precedente
all’API v2 e ai domini regionali.
Esempio di utilizzo come API di scripting
Sezione intitolata “Esempio di utilizzo come API di scripting”# source for use anonymously (secrets created anonymously)source ots.bash
# or, source with specific auth credentialsAPIUSER="USERNAME"APIKEY="APIKEY"source ots.bash -u $APIUSER -k $APIKEY
# check status of serverots_status
# create a secret and get back the URLURL=$(echo "secret" | ots_share)
# share a multi line secret via HEREDOC.URL=$(ots_share <<-EOF This is a Secret ... on multiple linesEOF)
# pass options to share or generate.URL=$(ots_share ttl=600 \ passphrase="shared-secret" \ recipient="someone@somewhere.com" <<< "SECRET")
# fetch the secret datalocal DATA="$(ots_retrieve "$URL")"
# share/generate a new secret, and get back the private metadata keylocal KEY=$(ots_metashare <<< "SECRET")local KEY=$(ots_metagenerate)
# get a list of private metadata keys recently created.# note that this requires valid authentication credentialslocal -a RECENT=( $(ots_recent) )
# check on the current state of a secret, given the private keyots_state $KEY
# burn a secret, given the private keyots_burn $KEYEsempio di utilizzo come CLI
Sezione intitolata “Esempio di utilizzo come CLI”# Share a secret (from stdin)./ots shareSECRET^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>